[Mondrian] Running the JUnit tests

Patrick Leckey patl at seewind.com
Wed Mar 21 16:30:51 EDT 2012


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>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20120321/4cb6b760/attachment.html 


More information about the Mondrian mailing list