Package mondrian.rolap
Class TestAggregationManager
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.rolap.BatchTestCase
-
- mondrian.rolap.TestAggregationManager
-
public class TestAggregationManager extends BatchTestCase
Unit test forAggregationManager
.- Since:
- 21 March, 2002
- Author:
- jhyde
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class mondrian.rolap.BatchTestCase
BatchTestCase.Bomb, BatchTestCase.CellRequestConstraint, BatchTestCase.TestCase, BatchTestCase.TestListener
-
-
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 TestAggregationManager()
TestAggregationManager(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setUp()
protected void
tearDown()
void
testAggChildMembersOfLeaf()
AstestAggMembers()
, but asks for children of a leaf level.void
testAggMembers()
Tests that an aggregate table is used to speed up a<Member>.Children
expression.void
testAggNameApproxRowCount()
This is a test for MONDRIAN-918 and MONDRIAN-903.void
testAggregatingTuples()
void
testAggStarWithIgnoredColumnsAndCountDistinct()
void
testAggStarWithIgnoredColumnsRequiresRollup()
void
testAggStarWithUnusedColumnsRequiresRollup()
void
testCollapsedChildren()
this test verifies the collapsed children code in SqlMemberSourcevoid
testColumnCadinalityCache()
Test that once fetched, column cardinality can be shared between different queries using the same connection.void
testCountDistinctAggMatch()
void
testCountDistinctAggMiss()
void
testCountDistinctBatchLoading()
Test that cells with the same compound member constraints are loaded in one Sql statement.void
testCountDistinctCannotRollup()
void
testCountDistinctRollup2()
As above, but we rollup [Marital Status] but not [Gender].void
testCountDistinctRollupAlongDim()
Now, here's a funny thing.void
testCountDistinctWithConstraintAggMiss()
Test that using compound member constrant disables using AggregateTablevoid
testDisabledReadAggregatesIgnoresDefaultRules()
void
testFemaleCustomerCount()
void
testFemaleCustomerCountWithConstraints()
void
testFemaleUnitSales()
void
testFemaleUnitSalesSql()
Tests that a request for ([Measures].[Unit Sales], [Gender].[F]) generates the correct SQL.void
testHierarchyInFactTable()
If a hierarchy lives in the fact table, we should not generate a join.void
testKeyExpressionCardinalityCache()
void
testLevelKeyAsSqlExpWithAgg()
void
testMondrian1271()
This is a test for MONDRIAN-1271 When a non-collapsed AggLevel was used, Mondrian would join on the key column of the lowest level instead of the one it should have.void
testMultipleMeasures()
Test a batch containing multiple measures: (store_state=CA, gender=F, measure=[Unit Sales]) (store_state=CA, gender=M, measure=[Store Sales]) (store_state=OR, gender=M, measure=[Unit Sales])void
testNonCollapsedAggregate()
void
testNonCollapsedAggregateAllLevelsPresentInQuery()
void
testNonCollapsedAggregateAllLevelsPresentInQuerySnowflake()
void
testNonEmptyCrossJoinLoneAxis()
Tests that a NonEmptyCrossJoin uses the measure referenced by the query (Store Sales) instead of the default measure (Unit Sales) in the case where the query only has one result axis.void
testNoNullPtrInCellRequest()
This test case tests for a null pointer that was being thrown inside of CellRequest.void
testOrdinalExprAggTuplesAndChildren()
void
testTwoNonCollapsedAggregate()
void
testUniqueMembers()
Tests that if a level is marked 'unique members', then its parent is not constrained.void
testVirtualCubeAggBugMondrian1221()
This is a test for MONDRIAN-1221 When performing a non-empty crossjoin over a virtual cube with agg tables, there was no match with any agg tables.-
Methods inherited from class mondrian.rolap.BatchTestCase
assertNative, assertNoQuerySql, assertNotNative, assertQuerySql, assertQuerySql, assertQuerySql, assertQuerySqlOrNot, assertRequestSql, assertRequestSql, checkNative, checkNative, checkNative, checkNotNative, checkNotNative, checkNotNative, clearAndHardenCache, createBatch, createBatch, createRequest, createRequest, createRequest, createRequest, dialectize, executeQuery, getCube, getFoodMartConnection, getGroupingSet, getMeasure, getRegistry, makeConstraintCountryState, makeConstraintProductFamilyDepartment, makeConstraintYearQuarterMonth, 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
-
testFemaleUnitSales
public void testFemaleUnitSales()
-
testFemaleCustomerCount
public void testFemaleCustomerCount()
-
testFemaleCustomerCountWithConstraints
public void testFemaleCustomerCountWithConstraints()
-
testFemaleUnitSalesSql
public void testFemaleUnitSalesSql()
Tests that a request for ([Measures].[Unit Sales], [Gender].[F]) generates the correct SQL.
-
testMultipleMeasures
public void testMultipleMeasures()
Test a batch containing multiple measures: (store_state=CA, gender=F, measure=[Unit Sales]) (store_state=CA, gender=M, measure=[Store Sales]) (store_state=OR, gender=M, measure=[Unit Sales])
-
testUniqueMembers
public void testUniqueMembers()
Tests that if a level is marked 'unique members', then its parent is not constrained.
-
testNonEmptyCrossJoinLoneAxis
public void testNonEmptyCrossJoinLoneAxis()
Tests that a NonEmptyCrossJoin uses the measure referenced by the query (Store Sales) instead of the default measure (Unit Sales) in the case where the query only has one result axis. The setup here is necessarily elaborate because the original bug was quite arbitrary.
-
testHierarchyInFactTable
public void testHierarchyInFactTable()
If a hierarchy lives in the fact table, we should not generate a join.
-
testCountDistinctAggMiss
public void testCountDistinctAggMiss()
-
testCountDistinctAggMatch
public void testCountDistinctAggMatch()
-
testCountDistinctCannotRollup
public void testCountDistinctCannotRollup()
-
testCountDistinctRollupAlongDim
public void testCountDistinctRollupAlongDim()
Now, here's a funny thing. Usually you can't roll up a distinct-count aggregate. But if you're rolling up along the dimension which the count is counting, it's OK. In this case, you know that every member can only belong to one group.
-
testCountDistinctRollup2
public void testCountDistinctRollup2()
As above, but we rollup [Marital Status] but not [Gender].
-
testCountDistinctBatchLoading
public void testCountDistinctBatchLoading()
Test that cells with the same compound member constraints are loaded in one Sql statement. Cells [Food] and [Drink] have the same constraint: {[1997].[Q1].[1], [1997].[Q3].[7]}
-
testAggMembers
public void testAggMembers()
Tests that an aggregate table is used to speed up a<Member>.Children
expression.
-
testAggChildMembersOfLeaf
public void testAggChildMembersOfLeaf()
AstestAggMembers()
, but asks for children of a leaf level. Rewrite using an aggregate table is not possible, so just check that it gets the right result.
-
testNoNullPtrInCellRequest
public void testNoNullPtrInCellRequest()
This test case tests for a null pointer that was being thrown inside of CellRequest.
-
testColumnCadinalityCache
public void testColumnCadinalityCache()
Test that once fetched, column cardinality can be shared between different queries using the same connection.Test also that expressions with only table alias difference do not share cardinality result.
-
testKeyExpressionCardinalityCache
public void testKeyExpressionCardinalityCache()
-
testCountDistinctWithConstraintAggMiss
public void testCountDistinctWithConstraintAggMiss()
Test that using compound member constrant disables using AggregateTable
-
testOrdinalExprAggTuplesAndChildren
public void testOrdinalExprAggTuplesAndChildren()
-
testAggregatingTuples
public void testAggregatingTuples()
-
testCollapsedChildren
public void testCollapsedChildren()
this test verifies the collapsed children code in SqlMemberSource
-
testLevelKeyAsSqlExpWithAgg
public void testLevelKeyAsSqlExpWithAgg()
Test case for bug MONDRIAN-812, "Issues with aggregate table recognition when using <KeyExpression><SQL> ... </SQL></KeyExpression> to define a level". Using a key expression for a level element would make aggregate tables fail to be used.
-
testAggNameApproxRowCount
public void testAggNameApproxRowCount()
This is a test for MONDRIAN-918 and MONDRIAN-903. We have added an attribute to AggName called approxRowCount so that the aggregation manager can optimize the aggregation tables without having to issue a select count() query.
-
testNonCollapsedAggregate
public void testNonCollapsedAggregate() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testNonCollapsedAggregateAllLevelsPresentInQuerySnowflake
public void testNonCollapsedAggregateAllLevelsPresentInQuerySnowflake() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testNonCollapsedAggregateAllLevelsPresentInQuery
public void testNonCollapsedAggregateAllLevelsPresentInQuery() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testTwoNonCollapsedAggregate
public void testTwoNonCollapsedAggregate() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testVirtualCubeAggBugMondrian1221
public void testVirtualCubeAggBugMondrian1221()
This is a test for MONDRIAN-1221 When performing a non-empty crossjoin over a virtual cube with agg tables, there was no match with any agg tables.
-
testMondrian1271
public void testMondrian1271()
This is a test for MONDRIAN-1271 When a non-collapsed AggLevel was used, Mondrian would join on the key column of the lowest level instead of the one it should have.
-
testAggStarWithIgnoredColumnsRequiresRollup
public void testAggStarWithIgnoredColumnsRequiresRollup()
-
testAggStarWithUnusedColumnsRequiresRollup
public void testAggStarWithUnusedColumnsRequiresRollup()
-
testAggStarWithIgnoredColumnsAndCountDistinct
public void testAggStarWithIgnoredColumnsAndCountDistinct()
-
testDisabledReadAggregatesIgnoresDefaultRules
public void testDisabledReadAggregatesIgnoresDefaultRules() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-