Package mondrian.rolap.sql
Class SqlQueryTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.rolap.BatchTestCase
-
- mondrian.rolap.sql.SqlQueryTest
-
public class SqlQueryTest extends BatchTestCase
Test forSqlQuery
.- Since:
- 06-Jun-2007
- Author:
- Thiyagu
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class mondrian.rolap.BatchTestCase
BatchTestCase.TestCase
-
-
Field Summary
-
Fields inherited from class mondrian.rolap.BatchTestCase
cubeNameSales, fieldGender, fieldProductDepartment, fieldProductFamily, fieldValueProductDepartment, fieldValuesGender, fieldValuesProductFamily, fieldValuesYear, fieldYear, measureUnitSales, tableCustomer, tableProductClass, tableTime
-
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
-
-
Constructor Summary
Constructors Constructor Description SqlQueryTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setUp()
protected void
tearDown()
void
testApproxRowCountOverridesCount()
This test makes sure that a level which specifies an approxRowCount property prevents Mondrian from executing a count() sql query.void
testAvgAggregator()
This is a test for MONDRIAN-1869void
testDoubleInList()
Verifies that the correct SQL string is generated for literals of SQL type "double".void
testInvalidSqlMemberLookup()
void
testLimitedRollupMemberRetrievableFromCache()
void
testOrderBy()
void
testPredicatesAreNotOptimizedWhenPropertyIsFalse()
void
testPredicatesAreOptimizedWhenAllTheMembersAreIncluded()
void
testPredicatesAreOptimizedWhenPropertyIsTrue()
void
testTableNameIsIncludedWithParentChildQuery()
void
testToStringForForcedIndexHint()
void
testToStringForGroupingSetSqlWithEmptyGroup()
void
testToStringForMultipleGroupingSetsSql()
void
testToStringForSingleGroupingSetSql()
-
Methods inherited from class mondrian.rolap.BatchTestCase
assertNative, assertNoQuerySql, assertNotNative, assertQuerySql, assertQuerySql, assertQuerySql, assertQuerySqlOrNot, assertRequestSql, assertRequestSql, checkNative, checkNative, checkNative, checkNotNative, checkNotNative, checkNotNative, createBatch, createBatch, createRequest, createRequest, createRequest, createRequest, dialectize, executeQuery, getCube, getFoodMartConnection, getGroupingSet, getMeasure, mysqlPattern, sqlPattern
-
Methods inherited from class mondrian.test.FoodMartTestCase
allMember, assertAxisReturns, assertAxisThrows, assertBooleanExprReturns, assertExprReturns, assertExprThrows, assertQueriesReturnSimilarResults, assertQueryReturns, assertQueryThrows, assertSize, cubeByName, execute, executeExpr, executeQuery, executeSingletonAxis, genderMembersIncludingAll, getConnection, getDimensionWithName, getTestContext, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, verifySameNativeAndNot, warehouseMembersCanadaMexicoUsa
-
-
-
-
Method Detail
-
setUp
protected void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
tearDown
protected void tearDown() throws java.lang.Exception
- Overrides:
tearDown
in classFoodMartTestCase
- Throws:
java.lang.Exception
-
testToStringForSingleGroupingSetSql
public void testToStringForSingleGroupingSetSql()
-
testOrderBy
public void testOrderBy() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
testToStringForForcedIndexHint
public void testToStringForForcedIndexHint()
-
testPredicatesAreOptimizedWhenPropertyIsTrue
public void testPredicatesAreOptimizedWhenPropertyIsTrue()
-
testTableNameIsIncludedWithParentChildQuery
public void testTableNameIsIncludedWithParentChildQuery()
-
testPredicatesAreNotOptimizedWhenPropertyIsFalse
public void testPredicatesAreNotOptimizedWhenPropertyIsFalse()
-
testPredicatesAreOptimizedWhenAllTheMembersAreIncluded
public void testPredicatesAreOptimizedWhenAllTheMembersAreIncluded()
-
testToStringForGroupingSetSqlWithEmptyGroup
public void testToStringForGroupingSetSqlWithEmptyGroup()
-
testToStringForMultipleGroupingSetsSql
public void testToStringForMultipleGroupingSetsSql()
-
testDoubleInList
public void testDoubleInList()
Verifies that the correct SQL string is generated for literals of SQL type "double".Mondrian only generates SQL DOUBLE values in a special format for LucidDB; therefore, this test is a no-op on other databases.
-
testInvalidSqlMemberLookup
public void testInvalidSqlMemberLookup()
Testcase for bug MONDRIAN-457, "Strange SQL condition appears when executing query". The fix implemented MatchType.EXACT_SCHEMA, which only queries known schema objects. This prevents SQL such as "UPPER(`store`.`store_country`) = UPPER('Time.Weekly')" from being generated.
-
testApproxRowCountOverridesCount
public void testApproxRowCountOverridesCount()
This test makes sure that a level which specifies an approxRowCount property prevents Mondrian from executing a count() sql query. It was discovered in bug MONDRIAN-711 that the aggregate tables predicates optimization code was not considering the approxRowCount property. It is fixed and this test will ensure it won't happen again.
-
testLimitedRollupMemberRetrievableFromCache
public void testLimitedRollupMemberRetrievableFromCache() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testAvgAggregator
public void testAvgAggregator()
This is a test for MONDRIAN-1869Avg Aggregates need to be computed in SQL to get correct values.
-
-