public class CalciteAssert extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CalciteAssert.AddSchemaPostProcessor
Adds
Schema and sets it as default. |
static class |
CalciteAssert.AddSchemaSpecPostProcessor
Adds
CalciteAssert.SchemaSpec (set of schemes) to a connection. |
static class |
CalciteAssert.AssertMetaData
Fluent interface for building a metadata query to be tested.
|
static class |
CalciteAssert.AssertQuery
Fluent interface for building a query to be tested.
|
static class |
CalciteAssert.AssertThat
Result of calling
that() . |
static class |
CalciteAssert.Config
Connection configuration.
|
static class |
CalciteAssert.ConnectionFactory
Abstract implementation of connection factory whose
with
methods throw. |
static interface |
CalciteAssert.ConnectionPostProcessor
Connection post processor
|
static class |
CalciteAssert.DatabaseInstance
Information necessary to create a JDBC connection.
|
static class |
CalciteAssert.SchemaSpec
Specification for common test schemas.
|
Modifier and Type | Field and Description |
---|---|
static CalciteAssert.DatabaseInstance |
DB
Which database to use for tests that require a JDBC data source.
|
static CalciteAssert.ConnectionFactory |
EMPTY_CONNECTION_FACTORY |
static boolean |
ENABLE_SLOW
Whether to enable slow tests.
|
Modifier and Type | Method and Description |
---|---|
static SchemaPlus |
addSchema(SchemaPlus rootSchema,
CalciteAssert.SchemaSpec schema) |
static void |
assertArrayEqual(String message,
Object[] expected,
Object[] actual)
Asserts that two objects are equal.
|
static com.google.common.base.Function<ResultSet,Void> |
checkMaskedResultContains(String expected) |
static com.google.common.base.Function<ResultSet,Void> |
checkResultContains(String... expected) |
static com.google.common.base.Function<ResultSet,Void> |
checkResultContains(String expected,
int count) |
static com.google.common.base.Function<ResultSet,Void> |
checkResultCount(org.hamcrest.Matcher<Integer> expected) |
static com.google.common.base.Function<ResultSet,Void> |
checkResultType(String expected) |
static com.google.common.base.Function<Integer,Void> |
checkUpdateCount(int expected) |
static CalciteAssert.AssertThat |
hr()
Short-hand for
CalciteAssert.that().with(Config.REGULAR) . |
static CalciteAssert.AssertThat |
model(String model)
Short-hand for
CalciteAssert.that().with(Config.EMPTY).withModel(model) . |
static CalciteAssert.AssertThat |
that()
Creates an instance of
CalciteAssert with the empty
configuration. |
static CalciteAssert.AssertThat |
that(CalciteAssert.Config config)
Creates an instance of
CalciteAssert with a given
configuration. |
public static final CalciteAssert.DatabaseInstance DB
We recommend that casual users use hsqldb, and frequent Calcite developers use MySQL. The test suite runs faster against the MySQL database (mainly because of the 0.1s versus 6s startup time). You have to populate MySQL manually with the foodmart data set, otherwise there will be test failures. To run against MySQL, specify '-Dcalcite.test.db=mysql' on the java command line.
public static final boolean ENABLE_SLOW
public static final CalciteAssert.ConnectionFactory EMPTY_CONNECTION_FACTORY
public static CalciteAssert.AssertThat that()
CalciteAssert
with the empty
configuration.public static CalciteAssert.AssertThat that(CalciteAssert.Config config)
CalciteAssert
with a given
configuration.public static CalciteAssert.AssertThat model(String model)
CalciteAssert.that().with(Config.EMPTY).withModel(model)
.public static CalciteAssert.AssertThat hr()
CalciteAssert.that().with(Config.REGULAR)
.public static com.google.common.base.Function<ResultSet,Void> checkResultCount(org.hamcrest.Matcher<Integer> expected)
public static com.google.common.base.Function<Integer,Void> checkUpdateCount(int expected)
public static com.google.common.base.Function<ResultSet,Void> checkResultContains(String... expected)
public static com.google.common.base.Function<ResultSet,Void> checkResultContains(String expected, int count)
public static com.google.common.base.Function<ResultSet,Void> checkMaskedResultContains(String expected)
public static com.google.common.base.Function<ResultSet,Void> checkResultType(String expected)
public static SchemaPlus addSchema(SchemaPlus rootSchema, CalciteAssert.SchemaSpec schema)
public static void assertArrayEqual(String message, Object[] expected, Object[] actual)
AssertionError
is thrown with the given message. If
expected
and actual
are null
,
they are considered equal.
This method produces more user-friendly error messages than
Assert.assertArrayEquals(String, Object[], Object[])
message
- the identifying message for the AssertionError
(null
okay)expected
- expected valueactual
- actual valueCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.