Package mondrian.test.comp
Class ResultComparatorTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.test.comp.ResultComparatorTest
-
public class ResultComparatorTest extends FoodMartTestCase
Unit test based upon an XML file.The file consists of an MDX statement and the expected result. The executes the MDX statement and fails if the actual result does not match the expected result.
Here is a typical XML file:
<mdbTest>
<mdxQuery>
WITH MEMBER [Customers].[Hierarchy Name]
AS '[Customers].[All Customers].[USA].[CA].hierarchy.Name'
SELECT {[Customers].[Hierarchy Name]} on columns
From [Sales]
</mdxQuery>
<dataResult>
<slicer>
<dimensions>
<dim>[Measures]</dim>
<dim>[Time]</dim>
<dim>[Product]</dim>
<dim>[Store]</dim>
<dim>[Store Size in SQFT]</dim>
<dim>[Store Type]</dim>
<dim>[Promotions]</dim>
<dim>[Education Level]</dim>
<dim>[Marital Status]</dim>
<dim>[Yearly Income]</dim>
<dim>[Promotion Media]</dim>
<dim>[Gender]</dim>
</dimensions>
<tuples>
<tuple>
<member>[Measures].[Unit Sales]</member>
<member>[Time].[1997]</member>
<member>[Product].[All Products]</member>
<member>[Store].[All Stores]</member>
<member>[Store Size in SQFT].[All Store Size in SQFTs]</member>
<member>[Store Type].[All Store Types]</member>
<member>[Promotions].[All Promotions]</member>
<member>[Education Level].[All Education Levels]</member>
<member>[Marital Status].[All Marital Status]</member>
<member>[Yearly Income].[All Yearly Incomes]</member>
<member>[Promotion Media].[All Media]</member>
<member>[Gender].[All Gender]</member>
</tuple>
</tuples>
</slicer>
<columns>
<dimensions>
<dim>[Customers]</dim>
</dimensions>
<tuples>
<tuple>
<member>[Customers].[Hierarchy Name]</member>
</tuple>
</tuples>
</columns>
<data>
<drow>
<cell>Customers</cell>
</drow>
</data>
</dataResult>
</mdbTest>
-
-
Field Summary
-
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
-
-
Constructor Summary
Constructors Constructor Description ResultComparatorTest()
ResultComparatorTest(java.io.File file)
ResultComparatorTest(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
runTest()
static TestSuite
suite()
-
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
-
-