mondrian.test
Class SchemaTest

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

public class SchemaTest
extends FoodMartTestCase

Unit tests for various schema features.

Since:
August 7, 2006
Version:
$Id: //open/mondrian-release/3.0/testsrc/main/mondrian/test/SchemaTest.java#7 $
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
nl
 
Constructor Summary
SchemaTest(String name)
           
 
Method Summary
 void _testValidatorFindsNumericLevel()
           
 void testAggTableSupportOfSharedDims()
          this test triggers an exception out of the aggregate table manager
 void testAllMemberMultipleDimensionUsages()
          Test to verify naming of all member with dimension usage name is different then source name
 void testAllMemberNoStringReplace()
           
 void testBinaryLevelKey()
          Test case for bug 1963913, "RolapMember causes ClassCastException in compare()", caused by binary column value.
 void testBug1578545()
          Bug 1578545, "ClassCastException in AggQuerySpec" occurs when two cubes have the same fact table, distinct aggregate tables, and measures with the same name.
 void testBug1746362()
          This tests for bug #1746362 Property column shifting when use captionColumn.
 void testCubeCaption()
           
 void testCubeHasFact()
           
 void testCubeWithNoDimensions()
           
 void testCubeWithNoMeasuresFails()
           
 void testCubeWithOneCalcMeasure()
           
 void testCubeWithOneDimensionOneMeasure()
           
 void testCubeWithOneDimensionUsageOneMeasure()
           
 void testDefaultMemberName()
          Test case for the issue described in Pentaho forum post 'wrong unique name for default member when hasAll=false'.
 void testDeprecatedDistinctCountAggregator()
          Tests that the deprecated "distinct count" value for the Measure@aggregator attribute still works.
 void testDimensionCreation()
          This test verifies that the createDimension() API call is working correctly.
 void testDimensionsShareJoinTable()
          WG: This no longer throws an exception, it is now possible Tests two dimensions using same table (via different join paths).
 void testDimensionsShareJoinTableOneAlias()
          Tests two dimensions using same table (via different join paths).
 void testDimensionsShareJoinTableTwoAliases()
          Tests two dimensions using same table (via different join paths).
 void testDimensionsShareTable()
          Tests two dimensions using same table (via different join paths).
 void testDimensionsShareTableNativeNonEmptyCrossJoin()
          Tests two dimensions using same table (via different join paths).
 void testDimensionsShareTableSameForeignKeys()
          Tests two dimensions using same table with same foreign key one table uses an alias.
 void testDimensionUsageLevel()
          Test DimensionUsage level attribute
 void testDuplicateTableAlias()
          WG: Note, this no longer throws an exception with the new RolapCubeMember functionality.
 void testDuplicateTableAliasSameForeignKey()
          This result is somewhat peculiar.
 void testHierarchyAbbreviatedDefaultMember()
           
 void testHierarchyBadDefaultMember()
           
 void testHierarchyDefaultMember()
           
 void testInvalidAggregator()
          Tests that an invalid aggregator causes an error.
 void testInvalidRoleError()
           
 void testInvalidSchemaAccess()
           
 void testLevelTableAttributeAsView()
          this test verifies that RolapHierarchy.tableExists() supports views
 void testMultipleDimensionHierarchyCaptionUsages()
          Test Multiple DimensionUsages on same Dimension.
 void testMultipleDimensionUsages()
          Test Multiple DimensionUsages on same Dimension.
 void testNonAliasedDimensionUsage()
          This test displays an informative error message if someone uses an unaliased name instead of an aliased name
 void testSnowflakeHierarchyValidationNotNeeded()
          test hierarchy with completely different join path to fact table than first hierarchy.
 void testSnowflakeHierarchyValidationNotNeeded2()
          test hierarchy with slightly different join path to fact table than first hierarchy.
 void testSolveOrderInCalculatedMember()
           
 void testTwoAliasesDimensionsShareTable()
          Tests two dimensions using same table (via different join paths).
 void testTwoAliasesDimensionsShareTableSameForeignKeys()
          Tests two dimensions using same table with same foreign key.
 void testUnionRole()
           
 void testUnionRoleContainsGrants()
           
 void testUnionRoleIllegalForwardRef()
           
 void testUnknownUsages()
          Testcase for Bug 1721514, "'unknown usage' messages".
 void testUnknownUsages1()
           
 void testViewFactTable()
          Tests a cube whose fact table is a <View> element.
 void testViewFactTable2()
          Tests a cube whose fact table is a <View> element, and which has dimensions based on the fact table.
 void testVirtualCubeNamedSetSupportInSchema()
           
 void testVirtualCubeNamedSetSupportInSchemaError()
           
 
Methods inherited from class mondrian.test.FoodMartTestCase
allMember, assertAxisReturns, assertAxisThrows, assertBooleanExprReturns, assertExprReturns, assertExprThrows, assertQueriesReturnSimilarResults, assertQueryReturns, assertSize, assertThrows, cubeByName, execute, executeExpr, executeQuery, executeSingletonAxis, fold, genderMembersIncludingAll, getConnection, getDimensionWithName, getTestContext, getTestContext, getTestContext, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, warehouseMembersCanadaMexicoUsa
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SchemaTest

public SchemaTest(String name)
Method Detail

testSolveOrderInCalculatedMember

public void testSolveOrderInCalculatedMember()

testHierarchyDefaultMember

public void testHierarchyDefaultMember()

testDefaultMemberName

public void testDefaultMemberName()
Test case for the issue described in Pentaho forum post 'wrong unique name for default member when hasAll=false'.


testHierarchyAbbreviatedDefaultMember

public void testHierarchyAbbreviatedDefaultMember()

testHierarchyBadDefaultMember

public void testHierarchyBadDefaultMember()

testDuplicateTableAlias

public void testDuplicateTableAlias()
WG: Note, this no longer throws an exception with the new RolapCubeMember functionality. Tests that an error is issued if two dimensions use the same table via different drill-paths and do not use a different alias. If this error is not issued, the generated SQL can be missing a join condition, as in Bug 1583462, "Mondrian generates invalid SQL".


testDuplicateTableAliasSameForeignKey

public void testDuplicateTableAliasSameForeignKey()
This result is somewhat peculiar. If two dimensions share a foreign key, what is the expected result? Also, in this case, they share the same table without an alias, and the system doesn't complain.


testDimensionsShareTable

public void testDimensionsShareTable()
Tests two dimensions using same table (via different join paths). Without the table alias, generates SQL which is missing a join condition. See testDuplicateTableAlias().


testDimensionsShareTableNativeNonEmptyCrossJoin

public void testDimensionsShareTableNativeNonEmptyCrossJoin()
Tests two dimensions using same table (via different join paths). native non empty cross join sql generation returns empty query. note that this works when native cross join is disabled


testDimensionsShareTableSameForeignKeys

public void testDimensionsShareTableSameForeignKeys()
Tests two dimensions using same table with same foreign key one table uses an alias.


testSnowflakeHierarchyValidationNotNeeded

public void testSnowflakeHierarchyValidationNotNeeded()
test hierarchy with completely different join path to fact table than first hierarchy. tables are auto-aliased as necessary to guarantee unique joins to the fact table.


testSnowflakeHierarchyValidationNotNeeded2

public void testSnowflakeHierarchyValidationNotNeeded2()
test hierarchy with slightly different join path to fact table than first hierarchy. tables from first and second hierarchy should contain the same join aliases to the fact table.


testDimensionsShareJoinTable

public void testDimensionsShareJoinTable()
WG: This no longer throws an exception, it is now possible Tests two dimensions using same table (via different join paths). both using a table alias.


testDimensionsShareJoinTableOneAlias

public void testDimensionsShareJoinTableOneAlias()
Tests two dimensions using same table (via different join paths). both using a table alias.


testDimensionsShareJoinTableTwoAliases

public void testDimensionsShareJoinTableTwoAliases()
Tests two dimensions using same table (via different join paths). both using a table alias.


testTwoAliasesDimensionsShareTable

public void testTwoAliasesDimensionsShareTable()
Tests two dimensions using same table (via different join paths). both using a table alias.


testTwoAliasesDimensionsShareTableSameForeignKeys

public void testTwoAliasesDimensionsShareTableSameForeignKeys()
Tests two dimensions using same table with same foreign key. both using a table alias.


testMultipleDimensionUsages

public void testMultipleDimensionUsages()
Test Multiple DimensionUsages on same Dimension. Alias the fact table to avoid issues with aggregation rules and multiple column names


testMultipleDimensionHierarchyCaptionUsages

public void testMultipleDimensionHierarchyCaptionUsages()
Test Multiple DimensionUsages on same Dimension. Alias the fact table to avoid issues with aggregation rules and multiple column names


testDimensionCreation

public void testDimensionCreation()
This test verifies that the createDimension() API call is working correctly.


testDimensionUsageLevel

public void testDimensionUsageLevel()
Test DimensionUsage level attribute


testAllMemberMultipleDimensionUsages

public void testAllMemberMultipleDimensionUsages()
Test to verify naming of all member with dimension usage name is different then source name


testNonAliasedDimensionUsage

public void testNonAliasedDimensionUsage()
This test displays an informative error message if someone uses an unaliased name instead of an aliased name


testViewFactTable

public void testViewFactTable()
Tests a cube whose fact table is a <View> element.


testViewFactTable2

public void testViewFactTable2()
Tests a cube whose fact table is a <View> element, and which has dimensions based on the fact table.


testDeprecatedDistinctCountAggregator

public void testDeprecatedDistinctCountAggregator()
Tests that the deprecated "distinct count" value for the Measure@aggregator attribute still works. The preferred value these days is "distinct-count".


testInvalidAggregator

public void testInvalidAggregator()
Tests that an invalid aggregator causes an error.


testUnknownUsages

public void testUnknownUsages()
Testcase for Bug 1721514, "'unknown usage' messages".


testUnknownUsages1

public void testUnknownUsages1()

testBug1578545

public void testBug1578545()
Bug 1578545, "ClassCastException in AggQuerySpec" occurs when two cubes have the same fact table, distinct aggregate tables, and measures with the same name.

This test case attempts to reproduce this issue by creating that environment, but it found a different issue: a measure came back with a cell value which was from a different measure. The root cause is probably the same: when measures are registered in a star, they should be qualified by cube name.


testBug1746362

public void testBug1746362()
This tests for bug #1746362 Property column shifting when use captionColumn.


testCubeWithOneDimensionOneMeasure

public void testCubeWithOneDimensionOneMeasure()

testCubeWithOneDimensionUsageOneMeasure

public void testCubeWithOneDimensionUsageOneMeasure()

testCubeHasFact

public void testCubeHasFact()

testCubeCaption

public void testCubeCaption()
                     throws SQLException
Throws:
SQLException

testCubeWithNoDimensions

public void testCubeWithNoDimensions()

testCubeWithNoMeasuresFails

public void testCubeWithNoMeasuresFails()

testCubeWithOneCalcMeasure

public void testCubeWithOneCalcMeasure()

testAggTableSupportOfSharedDims

public void testAggTableSupportOfSharedDims()
this test triggers an exception out of the aggregate table manager


testLevelTableAttributeAsView

public void testLevelTableAttributeAsView()
this test verifies that RolapHierarchy.tableExists() supports views


testInvalidSchemaAccess

public void testInvalidSchemaAccess()

testAllMemberNoStringReplace

public void testAllMemberNoStringReplace()

testUnionRole

public void testUnionRole()

testUnionRoleContainsGrants

public void testUnionRoleContainsGrants()

testUnionRoleIllegalForwardRef

public void testUnionRoleIllegalForwardRef()

testVirtualCubeNamedSetSupportInSchema

public void testVirtualCubeNamedSetSupportInSchema()

testVirtualCubeNamedSetSupportInSchemaError

public void testVirtualCubeNamedSetSupportInSchemaError()

_testValidatorFindsNumericLevel

public void _testValidatorFindsNumericLevel()

testInvalidRoleError

public void testInvalidRoleError()

testBinaryLevelKey

public void testBinaryLevelKey()
Test case for bug 1963913, "RolapMember causes ClassCastException in compare()", caused by binary column value.


SourceForge.net_Logo