mondrian.test
Class ParentChildHierarchyTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by mondrian.test.FoodMartTestCase
              extended by mondrian.test.ParentChildHierarchyTest
All Implemented Interfaces:
junit.framework.Test

public class ParentChildHierarchyTest
extends FoodMartTestCase

Tests for parent-child hierarchies.

Since:
Mar 6, 2003
Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.test.FoodMartTestCase
FoodMartTestCase.QueryAndResult
 
Field Summary
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
ParentChildHierarchyTest(String name)
           
 
Method Summary
 void _testNonClosureParentChildHierarchy()
          Test case for MONDRIAN-284, "Parent child hierarchies without closures are broken".
 void testAll()
           
 void testAllMembersParent()
           
 void testBridgeTable()
          Test case for MONDRIAN-441, "Parent-child hierarchies: <Join> used in dimension".
 void testBugMondrian168()
          Test case for MONDRIAN-168, "NullPointerException in RolapEvaluator.setContext(....)".
 void testChildrenOfAll()
           
 void testClosureTableInVirtualCube()
          Test case for MONDRIAN-488, "Closure Tables not working with Virtual Cubes".
 void testClosureVsNoClosure()
          Verifies the fix for MONDRIAN-519, a class cast exception when using non-closure parent child hierarchies.
 void testDistinctAll()
          Test case for MONDRIAN-75, "'distinct count' measure cause exception in parent/child".
 void testDistinctAllExplicitClosure()
          Verifies that COUNT DISTINCT works against the explict closure of the parent/child hierarchy.
 void testDistinctChildrenOfAll()
           
 void testDistinctChildrenOfAllExplicitClosure()
           
 void testDistinctSubtree()
           
 void testDistinctSubtreeExplicitClosure()
           
 void testGenuineCycle()
           
 void testHierarchyFalseCycle()
          The recursion cyclicity check kicks in when the recursion depth reachs the number of dimensions in the cube.
 void testLeaf()
           
 void testLevelMembers()
           
 void testOneAboveLeaf()
           
 void testParentChildDescendantsLeavesBottom()
          Script That Uses the LEAVES Flag to Return the Bottom 10 Dimension Members, from here.
 void testParentChildDescendantsLeavesTop()
          Script from here.
 void testParentChildDrillThrough()
           
 void testParentChildDrillThroughWithContext()
           
 void testParentChildOrdinal()
          Tests that a parent-child hierarchy is sorted correctly if the "ordinalColumn" attribute is included in its definition.
 void testPCCacheKeyBug()
          Fix for MONDRIAN-1225
 void testSchemaReaderLevelMembers()
           
 void testSharedClosureParentChildHierarchy()
           
 void testSnowflakeClosure()
          Tests snow flake closure combination.
 
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, tearDown, warehouseMembersCanadaMexicoUsa
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString
 
Methods inherited from class junit.framework.Assert
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParentChildHierarchyTest

public ParentChildHierarchyTest(String name)
Method Detail

testSnowflakeClosure

public void testSnowflakeClosure()
Tests snow flake closure combination.

Test case for MONDRIAN-266, "Closure tables do not work in a Snowflake Dimension".


testSharedClosureParentChildHierarchy

public void testSharedClosureParentChildHierarchy()

_testNonClosureParentChildHierarchy

public void _testNonClosureParentChildHierarchy()
Test case for MONDRIAN-284, "Parent child hierarchies without closures are broken".


testAll

public void testAll()

testChildrenOfAll

public void testChildrenOfAll()

testDistinctAll

public void testDistinctAll()
Test case for MONDRIAN-75, "'distinct count' measure cause exception in parent/child".


testDistinctChildrenOfAll

public void testDistinctChildrenOfAll()

testDistinctSubtree

public void testDistinctSubtree()

testDistinctAllExplicitClosure

public void testDistinctAllExplicitClosure()
Verifies that COUNT DISTINCT works against the explict closure of the parent/child hierarchy. (Repeats the last 4 tests.)


testDistinctChildrenOfAllExplicitClosure

public void testDistinctChildrenOfAllExplicitClosure()

testDistinctSubtreeExplicitClosure

public void testDistinctSubtreeExplicitClosure()

testLeaf

public void testLeaf()

testOneAboveLeaf

public void testOneAboveLeaf()

testParentChildDescendantsLeavesBottom

public void testParentChildDescendantsLeavesBottom()
Script That Uses the LEAVES Flag to Return the Bottom 10 Dimension Members, from here.


testParentChildDescendantsLeavesTop

public void testParentChildDescendantsLeavesTop()
Script from here.


testAllMembersParent

public void testAllMembersParent()

testHierarchyFalseCycle

public void testHierarchyFalseCycle()
The recursion cyclicity check kicks in when the recursion depth reachs the number of dimensions in the cube. So create a cube with fewer dimensions (3) than the depth of the emp dimension (6).


testGenuineCycle

public void testGenuineCycle()

testParentChildDrillThrough

public void testParentChildDrillThrough()

testParentChildDrillThroughWithContext

public void testParentChildDrillThroughWithContext()

testBugMondrian168

public void testBugMondrian168()
Test case for MONDRIAN-168, "NullPointerException in RolapEvaluator.setContext(....)".


testParentChildOrdinal

public void testParentChildOrdinal()
Tests that a parent-child hierarchy is sorted correctly if the "ordinalColumn" attribute is included in its definition. Testcase for MONDRIAN-203, "Sorting of Parent/Child Hierarchy is wrong".


testLevelMembers

public void testLevelMembers()

testClosureTableInVirtualCube

public void testClosureTableInVirtualCube()
Test case for MONDRIAN-488, "Closure Tables not working with Virtual Cubes".


testClosureVsNoClosure

public void testClosureVsNoClosure()
Verifies the fix for MONDRIAN-519, a class cast exception when using non-closure parent child hierarchies.


testSchemaReaderLevelMembers

public void testSchemaReaderLevelMembers()

testBridgeTable

public void testBridgeTable()
Test case for MONDRIAN-441, "Parent-child hierarchies: <Join> used in dimension".


testPCCacheKeyBug

public void testPCCacheKeyBug()
                       throws Exception
Fix for MONDRIAN-1225

When nativizing a set which contained a PC hierarchy, the SqlTupleReader would ask the cache for the parent member of the member it was populating, but the members are only put in cache at the second phase of the tuple computation, once all the members have been populated from SQL. Now, the SqlTupleReader keeps an intermediate key->member map so it can construct PC hierarchies correctly. This map gets picked up by the GC as soon as the SQL result set reaches its end and the tuple reader is closed, so there are no added cost to this.

Throws:
Exception

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads