Search in sources :

Example 1 with TestStatement

use of io.confluent.ksql.test.parser.TestStatement in project ksql by confluentinc.

the class KsqlTesterTest method test.

@Test
public void test() {
    for (final TestStatement testStatement : statements) {
        try {
            testStatement.consume(this::execute, this::doAssert, this::directive);
        } catch (final Throwable e) {
            handleExpectedException(testStatement, e);
            return;
        }
    }
    if (expectedException != null || expectedMessage != null) {
        final String clazz = expectedException == null ? "<any>" : expectedException.getName();
        final String msg = expectedMessage == null ? "<any>" : expectedMessage;
        throw new KsqlTestException(Iterables.getLast(statements), file, "Did not get expected exception of type " + clazz + " with message " + msg);
    }
}
Also used : KsqlTestException(io.confluent.ksql.test.KsqlTestException) TestStatement(io.confluent.ksql.test.parser.TestStatement) Test(org.junit.Test)

Aggregations

KsqlTestException (io.confluent.ksql.test.KsqlTestException)1 TestStatement (io.confluent.ksql.test.parser.TestStatement)1 Test (org.junit.Test)1