use of mondrian.olap.Position in project mondrian by pentaho.
the class BasicQueryTest method testAllLevelName.
public void testAllLevelName() {
TestContext testContext = TestContext.instance().createSubstitutingCube("Sales", "<Dimension name=\"Gender4\" foreignKey=\"customer_id\">\n" + " <Hierarchy hasAll=\"true\" allMemberName=\"All Gender\"\n" + " allLevelName=\"GenderLevel\" primaryKey=\"customer_id\">\n" + " <Table name=\"customer\"/>\n" + " <Level name=\"Gender\" column=\"gender\" uniqueMembers=\"true\"/>\n" + " </Hierarchy>\n" + "</Dimension>");
String mdx = "select {[Gender4].[All Gender]} on columns from Sales";
Result result = testContext.executeQuery(mdx);
Axis axis0 = result.getAxes()[0];
Position pos0 = axis0.getPositions().get(0);
Member allGender = pos0.get(0);
String caption = allGender.getLevel().getName();
Assert.assertEquals(caption, "GenderLevel");
}
Aggregations