Class SchemaTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.test.SchemaTest
-
public class SchemaTest extends FoodMartTestCase
Unit tests for various schema features.- Since:
- August 7, 2006
- Author:
- jhyde
- See Also:
SchemaVersionTest
,SharedDimensionTest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaTest.DummyPropertyFormatter
Implementation ofPropertyFormatter
that throws.-
Nested classes/interfaces inherited from class mondrian.test.FoodMartTestCase
FoodMartTestCase.QueryAndResult
-
-
Field Summary
-
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
-
-
Constructor Summary
Constructors Constructor Description SchemaTest(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
_testAttributeHierarchy()
void
_testNonUniqueAlias()
void
_testValidatorFindsNumericLevel()
void
checkBugMondrian1047(int n)
void
checkBugMondrian355(java.lang.String timeHalfYear)
void
testAggTableSupportOfSharedDims()
this test triggers an exception out of the aggregate table managervoid
testAllMemberMultipleDimensionUsages()
Test to verify naming of all member with dimension usage name is different then source namevoid
testAllMemberNoStringReplace()
void
testBinaryLevelKey()
Test case for bug MONDRIAN-413, "RolapMember causes ClassCastException in compare()", caused by binary column value.void
testBugMondrian1047()
void
testBugMondrian1065()
void
testBugMondrian233()
Bug MONDRIAN-233, "ClassCastException in AggQuerySpec" occurs when two cubes have the same fact table, distinct aggregate tables, and measures with the same name.void
testBugMondrian303()
Test case for bug MONDRIAN-303, "Property column shifting when use captionColumn".void
testBugMondrian355()
void
testBugMondrian463()
Unit test for bug MONDRIAN-463, "Snowflake dimension with 3-way join.".void
testBugMondrian482()
Test case for bug MONDRIAN-482, "ClassCastException when obtaining RolapCubeLevel".void
testBugMondrian747()
void
testBugMondrian923()
This is a test case for bug Mondrian-923.void
testCalcMemberInCube()
void
testCaption()
void
testCaptionDescriptionAndAnnotation()
Test for descriptions, captions and annotations of various schema elements.void
testCaptionWithOrdinalColumn()
Test for MONDRIAN-943 and MONDRIAN-465.void
testCollapsedError()
void
testCountMeasure()
Tests a measure based on 'count'.void
testCubeCaption()
void
testCubeHasFact()
void
testCubesVisibility()
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 attributevoid
testDimensionUsageVisibility()
void
testDimensionVisibility()
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
testHierarchyNoLevelsFails()
void
testHierarchyNonUniqueLevelsFails()
void
testHierarchyTableNotFound()
Tests that an error occurs if a hierarchy is based on a non-existent table.void
testHierarchyVisibility()
void
testInvalidAggregator()
Tests that an invalid aggregator causes an error.void
testInvalidRoleError()
void
testInvalidSchemaAccess()
void
testLeftDeepJoinFails()
Tests that a join nested left-deep, that is (Join (Join A B) C), fails.void
testLevelInternalType()
Test case for the Level@internalType attribute.void
testLevelInternalTypeErr()
Negative test for Level@internalType attribute.void
testLevelTableAttributeAsView()
Verifies that RolapHierarchy.tableExists() supports views.void
testLevelTableNotFound()
void
testLevelVisibility()
void
testMondrian1390()
This is a test for MONDRIAN-1390void
testMondrian1499()
void
testMultiByteSchemaReadFromFile()
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 namevoid
testNonCollapsedAggregate()
void
testNonCollapsedAggregateOnNonUniqueLevelFails()
void
testPrimaryKeyTableNotFound()
void
testPropertyFormatter()
void
testScdJoin()
Testcase for a problem which involved a slowly changing dimension.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
testTwoNonCollapsedAggregate()
void
testUnionRole()
void
testUnionRoleContainsGrants()
void
testUnionRoleIllegalForwardRef()
void
testUnknownUsages()
Testcase for Bug MONDRIAN-291, "'unknown usage' messages".void
testUnknownUsages1()
void
testViewDegenerateDims()
Tests a cube whose fact table is a <View> element as well as a degenerate dimension.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()
void
testVirtualCubesVisibility()
void
testVirtualDimensionVisibility()
-
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, verifySameNativeAndNot, warehouseMembersCanadaMexicoUsa
-
-
-
-
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()
-
testHierarchyNoLevelsFails
public void testHierarchyNoLevelsFails()
-
testHierarchyNonUniqueLevelsFails
public void testHierarchyNonUniqueLevelsFails()
-
testCountMeasure
public void testCountMeasure()
Tests a measure based on 'count'.
-
testHierarchyTableNotFound
public void testHierarchyTableNotFound()
Tests that an error occurs if a hierarchy is based on a non-existent table.
-
testPrimaryKeyTableNotFound
public void testPrimaryKeyTableNotFound()
-
testLevelTableNotFound
public void testLevelTableNotFound()
-
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 MONDRIAN-236, "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. SeetestDuplicateTableAlias()
.
-
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.
-
testMultipleDimensionHierarchyCaptionUsages
public void testMultipleDimensionHierarchyCaptionUsages()
Test Multiple DimensionUsages on same Dimension.
-
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
-
testViewDegenerateDims
public void testViewDegenerateDims()
Tests a cube whose fact table is a <View> element as well as a degenerate dimension.
-
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 MONDRIAN-291, "'unknown usage' messages".
-
testUnknownUsages1
public void testUnknownUsages1()
-
testPropertyFormatter
public void testPropertyFormatter()
-
testBugMondrian233
public void testBugMondrian233()
Bug MONDRIAN-233, "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.
-
testBugMondrian303
public void testBugMondrian303()
Test case for bug MONDRIAN-303, "Property column shifting when use captionColumn".
-
testCubeWithOneDimensionOneMeasure
public void testCubeWithOneDimensionOneMeasure()
-
testCubeWithOneDimensionUsageOneMeasure
public void testCubeWithOneDimensionUsageOneMeasure()
-
testCubeHasFact
public void testCubeHasFact()
-
testCubeCaption
public void testCubeCaption() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
testCubeWithNoDimensions
public void testCubeWithNoDimensions()
-
testCubeWithNoMeasuresFails
public void testCubeWithNoMeasuresFails()
-
testCubeWithOneCalcMeasure
public void testCubeWithOneCalcMeasure()
-
testCalcMemberInCube
public void testCalcMemberInCube()
-
testAggTableSupportOfSharedDims
public void testAggTableSupportOfSharedDims()
this test triggers an exception out of the aggregate table manager
-
testLevelTableAttributeAsView
public void testLevelTableAttributeAsView()
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 MONDRIAN-413, "RolapMember causes ClassCastException in compare()", caused by binary column value.
-
testLevelInternalType
public void testLevelInternalType()
Test case for the Level@internalType attribute.See bug MONDRIAN-896, "Oracle integer columns overflow if value >>2^31".
-
testLevelInternalTypeErr
public void testLevelInternalTypeErr()
Negative test for Level@internalType attribute.
-
_testAttributeHierarchy
public void _testAttributeHierarchy()
-
testScdJoin
public void testScdJoin()
Testcase for a problem which involved a slowly changing dimension. Not actually a slowly-changing dimension - we don't have such a thing in the foodmart schema - but the same structure. The dimension is a two table snowflake, and the table nearer to the fact table is not used by any level.
-
_testNonUniqueAlias
public void _testNonUniqueAlias()
-
testBugMondrian482
public void testBugMondrian482()
Test case for bug MONDRIAN-482, "ClassCastException when obtaining RolapCubeLevel".
-
testBugMondrian355
public void testBugMondrian355()
-
checkBugMondrian355
public void checkBugMondrian355(java.lang.String timeHalfYear)
-
testCaptionDescriptionAndAnnotation
public void testCaptionDescriptionAndAnnotation()
Test for descriptions, captions and annotations of various schema elements.
-
testCaption
public void testCaption()
-
testBugMondrian747
public void testBugMondrian747()
-
testBugMondrian463
public void testBugMondrian463()
Unit test for bug MONDRIAN-463, "Snowflake dimension with 3-way join.".
-
testLeftDeepJoinFails
public void testLeftDeepJoinFails()
Tests that a join nested left-deep, that is (Join (Join A B) C), fails. The correct way to use a join is right-deep, that is (Join A (Join B C)). Same schema astestBugMondrian463()
, except left-deep.
-
testCaptionWithOrdinalColumn
public void testCaptionWithOrdinalColumn()
Test for MONDRIAN-943 and MONDRIAN-465.
-
testBugMondrian923
public void testBugMondrian923() throws java.lang.Exception
This is a test case for bug Mondrian-923. When a virtual cube included calculated members in its schema, they were not included in the list of existing measures because of an override of the hierarchy schema reader which was done at cube init time when resolving the calculated members of the base cubes.- Throws:
java.lang.Exception
-
testCubesVisibility
public void testCubesVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testVirtualCubesVisibility
public void testVirtualCubesVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testDimensionVisibility
public void testDimensionVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testVirtualDimensionVisibility
public void testVirtualDimensionVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testDimensionUsageVisibility
public void testDimensionUsageVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testHierarchyVisibility
public void testHierarchyVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testLevelVisibility
public void testLevelVisibility() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testNonCollapsedAggregate
public void testNonCollapsedAggregate() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testNonCollapsedAggregateOnNonUniqueLevelFails
public void testNonCollapsedAggregateOnNonUniqueLevelFails() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testTwoNonCollapsedAggregate
public void testTwoNonCollapsedAggregate() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testCollapsedError
public void testCollapsedError() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testBugMondrian1047
public void testBugMondrian1047()
-
checkBugMondrian1047
public void checkBugMondrian1047(int n)
-
testBugMondrian1065
public void testBugMondrian1065()
-
testMondrian1390
public void testMondrian1390() throws java.lang.Exception
This is a test for MONDRIAN-1390Calling
SchemaReader.getLevelMembers(Level, boolean)
directly would return the null members at the end, since it was using TupleReader#readTuples instead of TupleReader#readMembers.- Throws:
java.lang.Exception
-
testMondrian1499
public void testMondrian1499() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testMultiByteSchemaReadFromFile
public void testMultiByteSchemaReadFromFile() throws java.io.IOException
- Throws:
java.io.IOException
-
-