public class TestCalculatedMembers extends BatchTestCase
BatchTestCase.TestCaseFoodMartTestCase.QueryAndResultcubeNameSales, fieldGender, fieldProductDepartment, fieldProductFamily, fieldValueProductDepartment, fieldValuesGender, fieldValuesProductFamily, fieldValuesYear, fieldYear, measureUnitSales, tableCustomer, tableProductClass, tableTimepropSaver| Constructor and Description | 
|---|
TestCalculatedMembers()  | 
TestCalculatedMembers(String name)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
_testWhole()  | 
void | 
testBracketInCalcMemberName()
Tests that calculated members can have brackets in their names. 
 | 
void | 
testBracketInCubeCalcMemberName()
Tests that calculated members defined in the schema can have brackets in
 their names. 
 | 
void | 
testBugMondrian852()
 | 
void | 
testCalcMemberCustomFormatterInNonMeasureInQuery()  | 
void | 
testCalcMemberCustomFormatterInQuery()  | 
void | 
testCalcMemberCustomFormatterInQueryNegative()  | 
void | 
testCalcMemberCustomFormatterInQueryNegative2()  | 
void | 
testCalcMemberCustomFormatterInSchema()  | 
void | 
testCalcMemberCustomFormatterInSchemaNegative()  | 
void | 
testCalcMemberIsSetFails()  | 
void | 
testCalcMemberParentOfCalcMember()  | 
void | 
testCalcMemberSameNameDifferentHierarchies()  | 
void | 
testCalcMemberTooDeep()  | 
void | 
testCalcMemberWithQuote()  | 
void | 
testCalculatedMemberCaption()  | 
void | 
testCalculatedMemberChildren()
Test case for
 MONDRIAN-335,
 "Issues with calculated members". 
 | 
void | 
testCalculatedMemberInCube()  | 
void | 
testCalculatedMemberInCubeAndQuery()  | 
void | 
testCalculatedMemberInCubeViaApi()  | 
void | 
testCalculatedMemberInCubeWithProps()  | 
void | 
testCalculatedMemberInCubeWithSpace()
Tests a calculated member with spaces in its name against a virtual
 cube with spaces in its name. 
 | 
void | 
testCalculatedMemberMSASCompatibility()  | 
void | 
testChildrenOfCalcMembers()  | 
void | 
testCompoundSlicerOverTuples()  | 
void | 
testCreateCalculatedMember()  | 
void | 
testCycleFalsePositive()
Test case for
 MONDRIAN-638,
 "Stack trace when grand total turned on". 
 | 
void | 
testEarlierCalcMember()
If there are multiple calc members with the same name, the first is
 chosen, even if it is not the best match. 
 | 
void | 
testExponentialPerformanceBugMondrian608()
Testcase for bug 
 MONDRIAN-608, "Performance issue with large number of measures". 
 | 
void | 
testFormatString()  | 
void | 
testNegativeSolveOrder()
Testcase for 
 bug MONDRIAN-263, Negative Solve Orders broken. 
 | 
void | 
testNegativeSolveOrderForCalMemberWithFilter()
Tests that if a filter is associated with input to a cal member with
 lower solve order; the filter computation uses the context that contains
 the other cal members(those with higher solve order). 
 | 
void | 
testNegativeSolveOrderForCalMemberWithFilters2()
Tests that if a filter is associated with input to a cal member with
 higher solve order; the filter computation ignores the other cal members. 
 | 
void | 
testNonCanonical()
Tests referring to a calc member by a name other than its canonical
 unique name. 
 | 
void | 
testNonCharacterMembers()  | 
void | 
testNonTopLevelCalculatedMember()
Test case for
 MONDRIAN-335,
 "Issues with calculated members". 
 | 
void | 
testNpeInIif()
Tests that IIf works OK even if its argument returns the NULL
 value. 
 | 
void | 
testPropertyReferencesCalcMember()  | 
void | 
testQueryCalcMemberOverridesShallowerStoredMember()  | 
void | 
testQueryCalculatedMemberOverridesCube()  | 
void | 
testQuoteInCalcMember()
 | 
void | 
testSetIncludesSelf()
Tests a calculated member which aggregates over a set which would seem
 to include the calculated member (but does not). 
 | 
void | 
testSimulatedCompoundSlicer()
Query that simulates a compound slicer by creating a calculated member
 that aggregates over a set and places it in the WHERE clause. 
 | 
void | 
testStrToSetInCubeCalcMember()
Testcase for bug 1784617, "Using StrToTuple() in schema errors out". 
 | 
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, getMeasureallMember, 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, warehouseMembersCanadaMexicoUsacountTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toStringassertEquals, 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, failpublic TestCalculatedMembers()
public TestCalculatedMembers(String name)
public void testCalculatedMemberInCube()
public void testCalculatedMemberInCubeViaApi()
public void testCalculatedMemberInCubeWithSpace()
public void testCalculatedMemberInCubeWithProps()
public void testCalculatedMemberInCubeAndQuery()
public void testQueryCalculatedMemberOverridesCube()
public void testQueryCalcMemberOverridesShallowerStoredMember()
public void testEarlierCalcMember()
public void _testWhole()
public void testCalculatedMemberCaption()
public void testCalcMemberIsSetFails()
public void testBracketInCalcMemberName()
public void testNpeInIif()
public void testBracketInCubeCalcMemberName()
public void testPropertyReferencesCalcMember()
public void testCalcMemberWithQuote()
public void testQuoteInCalcMember()
public void testChildrenOfCalcMembers()
public void testNonCharacterMembers()
public void testFormatString()
public void testNegativeSolveOrder()
public void testCalcMemberCustomFormatterInQuery()
public void testCalcMemberCustomFormatterInQueryNegative()
public void testCalcMemberCustomFormatterInQueryNegative2()
public void testCalcMemberCustomFormatterInNonMeasureInQuery()
public void testCalcMemberCustomFormatterInSchema()
public void testCalcMemberCustomFormatterInSchemaNegative()
public void testStrToSetInCubeCalcMember()
public void testCreateCalculatedMember()
public void testSetIncludesSelf()
public void testNegativeSolveOrderForCalMemberWithFilter()
public void testNegativeSolveOrderForCalMemberWithFilters2()
public void testNonTopLevelCalculatedMember()
public void testCalculatedMemberChildren()
public void testCalculatedMemberMSASCompatibility()
public void testSimulatedCompoundSlicer()
public void testCompoundSlicerOverTuples()
public void testExponentialPerformanceBugMondrian608()
public void testCycleFalsePositive()
public void testBugMondrian852()
The problem is in the implicit conversion that occurs when using a member as a numeric value. (In this case the conversion occurs because we apply the numeric operator '/'.) We have to assume at prepare time that the current measure will be numeric, but at run time the value may be a string.
We were wrongly throwing a ClassCastException. Correct behavior is an evaluation exception: the cell is in error, but the query as a whole succeeds.
public void testNonCanonical()
public void testCalcMemberParentOfCalcMember()
public void testCalcMemberSameNameDifferentHierarchies()
public void testCalcMemberTooDeep()