public class DialectTest
extends junit.framework.TestCase
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.
Modifier and Type | Class and Description |
---|---|
static class |
DialectTest.MockResultSetMetadata |
Constructor and Description |
---|
DialectTest(String name)
Creates a DialectTest.
|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
public DialectTest(String name)
name
- Test case nameprotected DataSource getDataSource()
protected void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
protected Dialect getDialect()
protected Connection getConnection()
public void testDialectVsDatabaseProduct() throws SQLException
SQLException
public void testAllowsCompoundCountDistinct()
public void testAllowsCountDistinct()
public void testAllowsMultipleCountDistinct()
public void testAllowsDdl()
public void testAllowsFromQuery()
public void testRequiresFromQueryAlias()
public void testRequiresOrderByAlias()
public void testAllowsOrderByAlias()
public void testRequiresUnionOrderByOrdinal()
public void testRequiresUnionOrderByExprToBeInSelectClause()
public void testSupportsGroupByExpressions()
public void testAllowsGroupingSets()
Dialect.supportsGroupingSets()
dialect property is accurate.public void testSupportsMultiValueInExpr()
public void testResultSetConcurrency()
public void testGenerateInline() throws SQLException
SQLException
public void testForceNullCollation() throws SQLException
SQLException
protected void assertQuerySucceeds(String sql)
sql
- SQL query in current dialectprotected void assertQueryFails(String sql, String[] patterns)
sql
- SQL querypatterns
- Array of expected patterns, generally one for each
SQL dialect for which the test is expected to failpublic void testAllowsSelectNotInGroupBy() throws SQLException
Dialect.allowsSelectNotInGroupBy()
.SQLException
public void testAllowsRegularExpressionInWhereClause() throws Exception
Exception
public void testComplexRegularExpression() throws Exception
Exception
public void testRegularExpressionSqlInjection() throws SQLException
SQLException
public void testOracleTypeMapQuirks() throws SQLException
SQLException
public void testPostgresGreenplumTypeMapQuirks() throws SQLException
SQLException
public void testNetezzaTypeMapQuirks() throws SQLException
SQLException
public void testMonetDBTypeMapQuirks() throws SQLException
SQLException
public void testJdbcDialectTypeMap() throws SQLException
SQLException