Package org.apache.calcite.test
Class CalciteAssert
java.lang.Object
org.apache.calcite.test.CalciteAssert
Fluid DSL for testing Calcite connections and queries.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFluent interface for building a metadata query to be tested.static classFluent interface for building a query to be tested.static classResult of callingthat().static enumConnection configuration.static interfaceConnection post-processor.static enumInformation necessary to create a JDBC connection.static interfaceWe want a consumer that can throw SqlException.static enumSpecification for common test schemas. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CalciteAssert.DatabaseInstanceWhich database to use for tests that require a JDBC data source. -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaPlusaddSchema(SchemaPlus rootSchema, CalciteAssert.SchemaSpec... schemas) Adds a schema specification (or specifications) to the root schema, returning the last one created.static voidassertArrayEqual(String message, Object[] expected, Object[] actual) Asserts that two objects are equal.checkMaskedResultContains(String expected) checkResultContains(String... expected) checkResultContains(String expected, int count) checkResultCount(org.hamcrest.Matcher<Integer> expected) checkResultType(String expected) checkUpdateCount(int expected) static CalciteAssert.AssertThathr()Short-hand forCalciteAssert.that().with(Config.REGULAR).static CalciteAssert.AssertThatShort-hand forCalciteAssert.that().with(Config.EMPTY).withModel(model).static CalciteAssert.AssertThatthat()Creates an instance ofCalciteAssertwith the empty configuration.static CalciteAssert.AssertThatthat(CalciteAssert.Config config) Creates an instance ofCalciteAssertwith a given configuration.static StringConverts aResultSetto a string.
-
Field Details
-
DB
Which database to use for tests that require a JDBC data source.- See Also:
-
-
Method Details
-
that
Creates an instance ofCalciteAssertwith the empty configuration. -
that
Creates an instance ofCalciteAssertwith a given configuration. -
model
Short-hand forCalciteAssert.that().with(Config.EMPTY).withModel(model). -
hr
Short-hand forCalciteAssert.that().with(Config.REGULAR). -
checkResultCount
-
checkUpdateCount
-
checkResultContains
-
checkResultContains
-
checkMaskedResultContains
-
checkResultType
-
toString
Converts aResultSetto a string.- Throws:
SQLException
-
addSchema
Adds a schema specification (or specifications) to the root schema, returning the last one created. -
assertArrayEqual
Asserts that two objects are equal. If they are not, anAssertionErroris thrown with the given message. Ifexpectedandactualarenull, they are considered equal.This method produces more user-friendly error messages than
Assertions.assertArrayEquals(Object[], Object[], String)- Parameters:
message- the identifying message for theAssertionError(nullokay)expected- expected valueactual- actual value
-