Class CalciteAssert.AssertThat

    • Method Detail

      • with

        public CalciteAssert.AssertThat with​(org.apache.calcite.avatica.ConnectionProperty property,
                                             java.lang.Object value)
      • withSchema

        public CalciteAssert.AssertThat withSchema​(java.lang.String name,
                                                   org.apache.calcite.schema.Schema schema)
        Sets the default schema to a given schema.
      • withDefaultSchema

        public CalciteAssert.AssertThat withDefaultSchema​(java.lang.String schema)
        Sets the default schema of the connection. Schema name may be null.
      • withMaterializations

        public final CalciteAssert.AssertThat withMaterializations​(java.lang.String model,
                                                                   java.lang.String... materializations)
      • withMaterializations

        public final CalciteAssert.AssertThat withMaterializations​(java.lang.String model,
                                                                   boolean existing,
                                                                   java.lang.String... materializations)
        Adds materializations to the schema.
      • withMaterializations

        public final CalciteAssert.AssertThat withMaterializations​(java.lang.String model,
                                                                   java.util.function.Function<org.apache.calcite.util.JsonBuilder,​java.util.List<java.lang.Object>> materializations)
        Adds materializations to the schema.
      • connectThrows

        public CalciteAssert.AssertThat connectThrows​(java.lang.String message)
        Asserts that there is an exception with the given message while creating a connection.
      • connectThrows

        public CalciteAssert.AssertThat connectThrows​(java.util.function.Consumer<java.lang.Throwable> exceptionChecker)
        Asserts that there is an exception that matches the given predicate while creating a connection.
      • doWithConnection

        public <T> CalciteAssert.AssertThat doWithConnection​(java.util.function.Function<org.apache.calcite.jdbc.CalciteConnection,​T> fn)
                                                      throws java.lang.Exception
        Creates a CalciteConnection and executes a callback.
        Throws:
        java.lang.Exception
      • doWithConnection

        public final CalciteAssert.AssertThat doWithConnection​(java.util.function.Consumer<org.apache.calcite.jdbc.CalciteConnection> fn)
                                                        throws java.lang.Exception
        Creates a CalciteConnection and executes a callback that returns no result.
        Throws:
        java.lang.Exception
      • doWithDataContext

        public <T> CalciteAssert.AssertThat doWithDataContext​(java.util.function.Function<org.apache.calcite.DataContext,​T> fn)
                                                       throws java.lang.Exception
        Creates a DataContext and executes a callback.
        Throws:
        java.lang.Exception
      • connect

        public java.sql.Connection connect()
                                    throws java.sql.SQLException
        Use sparingly. Does not close the connection.
        Throws:
        java.sql.SQLException
      • pooled

        public CalciteAssert.AssertThat pooled()
        Returns a version that uses a single connection, as opposed to creating a new one each time a test method is invoked.
      • metaData

        public CalciteAssert.AssertMetaData metaData​(java.util.function.Function<java.sql.Connection,​java.sql.ResultSet> function)