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
Modifier and TypeClassDescriptionstatic class
Fluent interface for building a metadata query to be tested.static class
Fluent interface for building a query to be tested.static class
Result of callingthat()
.static enum
Connection configuration.static interface
Connection post-processor.static enum
Information necessary to create a JDBC connection.static interface
We want a consumer that can throw SqlException.static enum
Specification for common test schemas. -
Field Summary
Modifier and TypeFieldDescriptionstatic final CalciteAssert.DatabaseInstance
Which database to use for tests that require a JDBC data source. -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaPlus
addSchema
(SchemaPlus rootSchema, CalciteAssert.SchemaSpec... schemas) Adds a schema specification (or specifications) to the root schema, returning the last one created.static void
assertArrayEqual
(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.AssertThat
hr()
Short-hand forCalciteAssert.that().with(Config.REGULAR)
.static CalciteAssert.AssertThat
Short-hand forCalciteAssert.that().with(Config.EMPTY).withModel(model)
.static CalciteAssert.AssertThat
that()
Creates an instance ofCalciteAssert
with the empty configuration.static CalciteAssert.AssertThat
that
(CalciteAssert.Config config) Creates an instance ofCalciteAssert
with a given configuration.static String
Converts aResultSet
to 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 ofCalciteAssert
with the empty configuration. -
that
Creates an instance ofCalciteAssert
with 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 aResultSet
to 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, anAssertionError
is thrown with the given message. Ifexpected
andactual
arenull
, 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
(null
okay)expected
- expected valueactual
- actual value
-