mondrian.test.comp
Class ResultComparatorTest

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

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
ResultComparatorTest()
           
ResultComparatorTest(File file)
           
ResultComparatorTest(String name)
           
 
Method Summary
protected  void runTest()
           
static junit.framework.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, warehouseMembersCanadaMexicoUsa
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, 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

ResultComparatorTest

public ResultComparatorTest(String name)

ResultComparatorTest

public ResultComparatorTest()

ResultComparatorTest

public ResultComparatorTest(File file)
Method Detail

runTest

protected void runTest()
                throws Exception
Overrides:
runTest in class junit.framework.TestCase
Throws:
Exception

suite

public static junit.framework.TestSuite suite()

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