Class SqlRuntimeTester

    • Constructor Detail

      • SqlRuntimeTester

        public SqlRuntimeTester​(SqlTestFactory factory)
    • Method Detail

      • checkFails

        public void checkFails​(java.lang.String expression,
                               java.lang.String expectedError,
                               boolean runtime)
        Description copied from interface: SqlTester
        Tests that a scalar SQL expression fails at run time.
        Specified by:
        checkFails in interface SqlTester
        Overrides:
        checkFails in class AbstractSqlTester
        Parameters:
        expression - SQL scalar expression
        expectedError - Pattern for expected error. If !runtime, must include an error location.
        runtime - If true, must fail at runtime; if false, must fail at validate time
      • assertExceptionIsThrown

        public void assertExceptionIsThrown​(java.lang.String sql,
                                            java.lang.String expectedMsgPattern)
        Description copied from interface: SqlValidatorTestCase.Tester
        Checks that a query is valid, or, if invalid, throws the right message at the right location.

        If expectedMsgPattern is null, the query must succeed.

        If expectedMsgPattern is not null, the query must fail, and give an error location of (expectedLine, expectedColumn) through (expectedEndLine, expectedEndColumn).

        Specified by:
        assertExceptionIsThrown in interface SqlValidatorTestCase.Tester
        Overrides:
        assertExceptionIsThrown in class AbstractSqlTester
        Parameters:
        sql - SQL statement
        expectedMsgPattern - If this parameter is null the query must be valid for the test to pass; If this parameter is not null the query must be malformed and the message given must match the pattern
      • assertExceptionIsThrown

        public void assertExceptionIsThrown​(java.lang.String sql,
                                            java.lang.String expectedMsgPattern,
                                            boolean runtime)