Package mondrian.test
Class DialectTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.DialectTest
-
public class DialectTest extends TestCase
Unit test which checks thatDialect
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DialectTest.MockResultSetMetadata
-
Constructor Summary
Constructors Constructor Description DialectTest(String name)
Creates a DialectTest.
-
Method Summary
-
-
-
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()
-
testDialectVsDatabaseProduct
public void testDialectVsDatabaseProduct() throws SQLException
- Throws:
SQLException
-
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()
-
testAllowsGroupingSets
public void testAllowsGroupingSets()
Tests that theDialect.supportsGroupingSets()
dialect property is accurate.
-
testSupportsMultiValueInExpr
public void testSupportsMultiValueInExpr()
-
testDateLiteralString
public void testDateLiteralString()
-
testBigInt
public void testBigInt()
-
testResultSetConcurrency
public void testResultSetConcurrency()
-
testGenerateInline
public void testGenerateInline() throws SQLException
- Throws:
SQLException
-
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 querypatterns
- Array of expected patterns, generally one for each SQL dialect for which the test is expected to fail
-
testAllowsSelectNotInGroupBy
public void testAllowsSelectNotInGroupBy() throws SQLException
Unit test forDialect.allowsSelectNotInGroupBy()
.- Throws:
SQLException
-
testAllowsRegularExpressionInWhereClause
public void testAllowsRegularExpressionInWhereClause() throws Exception
- Throws:
Exception
-
testComplexRegularExpression
public void testComplexRegularExpression() throws Exception
This is a test for http://jira.pentaho.com/browse/MONDRIAN-1057 Some dialects are not removing the \Q and \E markers if they are in the middle of the regexp.- Throws:
Exception
-
testRegularExpressionSqlInjection
public void testRegularExpressionSqlInjection() throws SQLException
- Throws:
SQLException
-
testOracleTypeMapQuirks
public void testOracleTypeMapQuirks() throws SQLException
- Throws:
SQLException
-
testPostgresGreenplumTypeMapQuirks
public void testPostgresGreenplumTypeMapQuirks() throws SQLException
- Throws:
SQLException
-
testNetezzaTypeMapQuirks
public void testNetezzaTypeMapQuirks() throws SQLException
- Throws:
SQLException
-
testMonetDBTypeMapQuirks
public void testMonetDBTypeMapQuirks() throws SQLException
- Throws:
SQLException
-
testJdbcDialectTypeMap
public void testJdbcDialectTypeMap() throws SQLException
- Throws:
SQLException
-
testMonetBooleanColumn
public void testMonetBooleanColumn() throws SQLException
- Throws:
SQLException
-
testHiveTimestampQuoteLiteral
public void testHiveTimestampQuoteLiteral() throws SQLException
- Throws:
SQLException
-
-