Class 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>
    • Constructor Detail

      • ResultComparatorTest

        public ResultComparatorTest​(String name)
      • ResultComparatorTest

        public ResultComparatorTest()
      • ResultComparatorTest

        public ResultComparatorTest​(File file)
    • Method Detail

      • suite

        public static TestSuite suite()