[Mondrian] Running the JUnit tests
Patrick Leckey
patl at seewind.com
Thu Mar 22 09:47:05 EDT 2012
Haven't tried CsvDBTestCase yet, was hoping it was something I was doing wrong with inline tables. :) I'll give it a shot today.
Thanks,
Pat
On 2012-03-21, at 8:24 PM, Julian Hyde wrote:
> There are a few places where an InlineTable cannot be used in place of a regular table. (Not that it shouldn't -- but it's never been implemented.) I can well believe that this is one of those.
>
> Sorry! I know it would have made it easier to write the test. InlineTable support will be better in mondrian-4, by the way.
>
> Did you try extending CsvDBTestCase? That allows you to create a table at the start of the test, and drop it at the end.
>
> Julian
>
> On Mar 21, 2012, at 1:30 PM, Patrick Leckey wrote:
>
>> Julian,
>>
>> I am working with TestContext.create() as you suggested, and am trying to accomplish this with an inline table (since I need data not in the FoodMart SQL). It looks promising, but I the test is failing with the following error:
>>
>> Mondrian Error:Internal error: no table 'store_management' found in hierarchy [Store Managers.Manager]
>>
>> Which seems to be failing in HierarchyUsage.findJoinTable() (specifically the exception thrown at line 429). Are inline tables not able to be used this way?
>>
>> I have defined the cube I am adding with TestContext.create() as follows:
>>
>> <Cube name="ClosureTest">
>> <InlineTable alias="store_management">
>> <ColumnDefs>
>> <ColumnDef name="store_id" type="Numeric"/>
>> <ColumnDef name="employee_id" type="Numeric"/>
>> <ColumnDef name="supervisor_id" type="Numeric"/>
>> <ColumnDef name="manager_rank" type="Numeric"/>
>> </ColumnDefs>
>> <Rows>
>> <Row>
>> <Value column="store_id">2</Value>
>> <Value column="employee_id">29</Value>
>> <Value column="supervisor_id">22</Value>
>> <Value column="manager_rank">1</Value>
>> </Row>
>> <Row>
>> <Value column="store_id">3</Value>
>> <Value column="employee_id">30</Value>
>> <Value column="supervisor_id">22</Value>
>> <Value column="manager_rank">2</Value>
>> </Row>
>> <Row>
>> <Value column="store_id">4</Value>
>> <Value column="employee_id">15</Value>
>> <Value column="supervisor_id">5</Value>
>> <Value column="manager_rank">3</Value>
>> </Row>
>> <Row>
>> <Value column="store_id">5</Value>
>> <Value column="employee_id">12</Value>
>> <Value column="supervisor_id">5</Value>
>> <Value column="manager_rank">4</Value>
>> </Row>
>> </Rows>
>> </InlineTable>
>>
>> <Dimension name="Store Managers" foreignKey="store_id">
>> <Hierarchy hasAll="true" allMemberName="All Managers"
>> primaryKey="store_id" primaryKeyTable="store_management"
>> name="Manager">
>> <Table name="employee"/>
>> <Level name="Employee Id" type="Numeric" uniqueMembers="true"
>> column="employee_id" parentColumn="supervisor_id"
>> nameColumn="full_name" nullParentValue="0">
>> <Closure parentColumn="supervisor_id" childColumn="employee_id">
>> <Table name="employee_closure"/>
>> </Closure>
>> </Level>
>> </Hierarchy>
>> </Dimension>
>>
>> <Measure name="Rank" column="manager_rank" aggregator="min" formatString="Standard"/>
>> </Cube>
>>
>> _______________________________________________
>> Mondrian mailing list
>> Mondrian at pentaho.org
>> http://lists.pentaho.org/mailman/listinfo/mondrian
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20120322/7702ada8/attachment-0001.html
More information about the Mondrian
mailing list