Package mondrian.test

Class DialectTest


  • public class DialectTest
    extends TestCase
    Unit test which checks that Dialect accurately represents the capabilities of the underlying database.

    The existing mondrian tests, when run on various databases and drivers, make sure that Dialect never over-states the capabilities of a particular database. But sometimes they under-state a database's capabilities: for example, MySQL version 3 did not allow subqueries in the FROM clause, but version 4 does. This test helps ensure that mondrian is using the full capabilities of each database.

    NOTE: If you see failures in this test, let the mondrian developers know! You may be running a version of a database which no one has tried before, and which has more capabilities than we expect. If you tell us about them, we can change mondrian to use those features.

    Since:
    May 18, 2007
    Author:
    jhyde
    • Constructor Detail

      • DialectTest

        public DialectTest​(String name)
        Creates a DialectTest.
        Parameters:
        name - Test case name
    • Method Detail

      • getDataSource

        protected DataSource getDataSource()
      • getDialect

        protected Dialect getDialect()
      • getConnection

        protected Connection getConnection()
      • testAllowsCompoundCountDistinct

        public void testAllowsCompoundCountDistinct()
      • testAllowsCountDistinct

        public void testAllowsCountDistinct()
      • testAllowsMultipleCountDistinct

        public void testAllowsMultipleCountDistinct()
      • testAllowsDdl

        public void testAllowsDdl()
      • testAllowsFromQuery

        public void testAllowsFromQuery()
      • testRequiresFromQueryAlias

        public void testRequiresFromQueryAlias()
      • testRequiresOrderByAlias

        public void testRequiresOrderByAlias()
      • testAllowsOrderByAlias

        public void testAllowsOrderByAlias()
      • testRequiresUnionOrderByOrdinal

        public void testRequiresUnionOrderByOrdinal()
      • testRequiresUnionOrderByExprToBeInSelectClause

        public void testRequiresUnionOrderByExprToBeInSelectClause()
      • testSupportsGroupByExpressions

        public void testSupportsGroupByExpressions()
      • testSupportsMultiValueInExpr

        public void testSupportsMultiValueInExpr()
      • testDateLiteralString

        public void testDateLiteralString()
      • testBigInt

        public void testBigInt()
      • testResultSetConcurrency

        public void testResultSetConcurrency()
      • testForceNullCollation

        public void testForceNullCollation()
                                    throws SQLException
        Tests that the dialect can generate a valid query to sort ascending and descending, with NULL values appearing last in both cases.
        Throws:
        SQLException
      • assertQuerySucceeds

        protected void assertQuerySucceeds​(String sql)
        Asserts that a query succeeds and produces at least one row.
        Parameters:
        sql - SQL query in current dialect
      • assertQueryFails

        protected void assertQueryFails​(String sql,
                                        String[] patterns)
        Asserts that a query fails.
        Parameters:
        sql - SQL query
        patterns - Array of expected patterns, generally one for each SQL dialect for which the test is expected to fail
      • testHavingRequiresAlias

        public void testHavingRequiresAlias()
                                     throws Exception
        Throws:
        Exception
      • testAllowsRegularExpressionInWhereClause

        public void testAllowsRegularExpressionInWhereClause()
                                                      throws Exception
        Throws:
        Exception
      • testRegularExpressionSqlInjection

        public void testRegularExpressionSqlInjection()
                                               throws SQLException
        Throws:
        SQLException
      • testPostgresGreenplumTypeMapQuirks

        public void testPostgresGreenplumTypeMapQuirks()
                                                throws SQLException
        Throws:
        SQLException