Class CalciteRemoteDriverTest


  • @NotThreadSafe
    public class CalciteRemoteDriverTest
    extends java.lang.Object
    Test for Calcite's remote JDBC driver. Technically speaking, the test is thread safe, however Caclite/Avatica have thread-safety issues see https://issues.apache.org/jira/browse/CALCITE-2853.
    • Field Detail

      • LJS

        public static final java.lang.String LJS
      • out

        private final java.io.PrintWriter out
      • GET_SCHEMAS

        private static final java.util.function.Function<java.sql.Connection,​java.sql.ResultSet> GET_SCHEMAS
      • GET_CATALOGS

        private static final java.util.function.Function<java.sql.Connection,​java.sql.ResultSet> GET_CATALOGS
      • GET_COLUMNS

        private static final java.util.function.Function<java.sql.Connection,​java.sql.ResultSet> GET_COLUMNS
      • GET_TYPEINFO

        private static final java.util.function.Function<java.sql.Connection,​java.sql.ResultSet> GET_TYPEINFO
      • GET_TABLE_TYPES

        private static final java.util.function.Function<java.sql.Connection,​java.sql.ResultSet> GET_TABLE_TYPES
      • localConnection

        private static java.sql.Connection localConnection
      • start

        private static org.apache.calcite.avatica.server.HttpServer start
      • SAMPLE_VALUES

        private static final java.util.List<java.lang.Object> SAMPLE_VALUES
        A bunch of sample values of various types.
    • Constructor Detail

      • CalciteRemoteDriverTest

        public CalciteRemoteDriverTest()
    • Method Detail

      • beforeClass

        public static void beforeClass()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRemoteConnection

        protected static java.sql.Connection getRemoteConnection()
                                                          throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • afterClass

        public static void afterClass()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testCatalogsLocal

        public void testCatalogsLocal()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSchemasLocal

        public void testSchemasLocal()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testMetaFunctionsLocal

        public void testMetaFunctionsLocal()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteCatalogs

        public void testRemoteCatalogs()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteSchemas

        public void testRemoteSchemas()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteColumns

        public void testRemoteColumns()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteTypeInfo

        public void testRemoteTypeInfo()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteTableTypes

        public void testRemoteTableTypes()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteExecuteQuery

        public void testRemoteExecuteQuery()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteExecuteQuery2

        public void testRemoteExecuteQuery2()
                                     throws java.lang.Exception
        Same query as testRemoteExecuteQuery(), run without the test infrastructure.
        Throws:
        java.lang.Exception
      • testParameterConvert

        public void testParameterConvert()
                                  throws java.lang.Exception
        For each (source, destination) type, make sure that we can convert bind variables.
        Throws:
        java.lang.Exception
      • testTableB5

        public void testTableB5()
        Check that the "set" conversion table looks like Table B-5 in JDBC 4.1 specification
      • pad

        private java.lang.String pad​(java.lang.String x)
      • testTableB6

        public void testTableB6()
        Check that the "get" conversion table looks like Table B-5 in JDBC 4.1 specification
      • testAvaticaConnectionException

        public void testAvaticaConnectionException()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testAvaticaStatementException

        public void testAvaticaStatementException()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testAvaticaStatementGetMoreResults

        public void testAvaticaStatementGetMoreResults()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteExecute

        public void testRemoteExecute()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemoteExecuteMaxRow

        public void testRemoteExecuteMaxRow()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • makeConnection

        public static java.sql.Connection makeConnection()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testLocalStatementFetch

        public void testLocalStatementFetch()
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testLocalPreparedStatementFetch

        public void testLocalPreparedStatementFetch()
                                             throws java.lang.Exception
        Test that returns all result sets in one go.
        Throws:
        java.lang.Exception
      • testRemoteStatementFetch

        public void testRemoteStatementFetch()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRemotePreparedStatementFetch

        public void testRemotePreparedStatementFetch()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • values

        private static java.util.List<java.lang.Object> values​(java.lang.Class clazz)
      • convert

        private java.lang.Object convert​(java.lang.Object o,
                                         java.lang.Class clazz)
                                  throws java.text.ParseException
        Throws:
        java.text.ParseException
      • testInsert

        public void testInsert()
                        throws java.lang.Exception
        Test remote Statement insert.
        Throws:
        java.lang.Exception
      • testInsertBatch

        public void testInsertBatch()
                             throws java.lang.Exception
        Test remote Statement batched insert.
        Throws:
        java.lang.Exception
      • testRemotePreparedStatementInsert

        public void testRemotePreparedStatementInsert()
                                               throws java.lang.Exception
        Remote PreparedStatement insert WITHOUT bind variables
        Throws:
        java.lang.Exception
      • testRemotePreparedStatementInsert2

        public void testRemotePreparedStatementInsert2()
                                                throws java.lang.Exception
        Remote PreparedStatement insert WITH bind variables
        Throws:
        java.lang.Exception