Skip to content

Commit

Permalink
Tweaks to getSharedDimensions fix, and more testing.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@465 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Jul 26, 2011
1 parent 26f6862 commit 015876e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1169,11 +1169,9 @@ public int compare(
}
});
}
if (this.cubeForCallback != null) {
this.cubeForCallback.dimensionsByUname.put(
dimension.getUniqueName(),
dimension);
}
this.cubeForCallback.dimensionsByUname.put(
dimension.getUniqueName(),
dimension);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class XmlaOlap4jSchema implements Schema, Named {
this.sharedDimensions = new DeferredNamedListImpl<XmlaOlap4jDimension>(
XmlaOlap4jConnection.MetadataRequest.MDSCHEMA_DIMENSIONS,
context,
new XmlaOlap4jConnection.DimensionHandler(null),
new XmlaOlap4jConnection.DimensionHandler(sharedCube),
restrictions);
}

Expand Down
12 changes: 12 additions & 0 deletions testsrc/org/olap4j/ConnectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,18 @@ public void testSchemaGetSharedDimensions() throws Exception {
"Time",
"Warehouse"),
list);

int hierarchyCount = 0, levelCount = 0;
for (Dimension sharedDimension : sharedDimensions) {
for (Hierarchy hierarchy : sharedDimension.getHierarchies()) {
++hierarchyCount;
for (Level level : hierarchy.getLevels()) {
++levelCount;
}
}
}
assertTrue(hierarchyCount > 0);
assertTrue(levelCount > 0);
}

/**
Expand Down

0 comments on commit 015876e

Please sign in to comment.