From 6304f017200fea5990f7b7b91b99e9aff333f9a6 Mon Sep 17 00:00:00 2001 From: Paul Stoellberger Date: Fri, 24 Jun 2011 01:08:46 +0000 Subject: [PATCH] Test case for Bug 3312701. calculated measures in virtual cube ignored git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@457 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- src/org/olap4j/impl/Bug.java | 8 +++++ testsrc/org/olap4j/ConnectionTest.java | 44 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/org/olap4j/impl/Bug.java b/src/org/olap4j/impl/Bug.java index 35340e6..77e95f6 100644 --- a/src/org/olap4j/impl/Bug.java +++ b/src/org/olap4j/impl/Bug.java @@ -60,6 +60,14 @@ public abstract class Bug { * is fixed. */ public static final boolean BugOlap4j3126853Fixed = false; + + /** + * Whether + * bug 3312701, + * "ConnectionTest.testVirtualCubeCmBug hangs" + * is fixed. + */ + public static final boolean BugOlap4j3312701Fixed = false; } // End Bug.java diff --git a/testsrc/org/olap4j/ConnectionTest.java b/testsrc/org/olap4j/ConnectionTest.java index 5d93295..321a5f9 100644 --- a/testsrc/org/olap4j/ConnectionTest.java +++ b/testsrc/org/olap4j/ConnectionTest.java @@ -2031,6 +2031,50 @@ public void testMetadata() throws Exception { measureNameSet); } + /** + * Testcase for bug 3312701, "VirtualCube doesn't show + * Calculated Members" + */ + public void testVirtualCubeCmBug() throws Exception { + if (!Bug.BugOlap4j3312701Fixed) { + return; + } + Class.forName(tester.getDriverClassName()); + connection = tester.createConnection(); + OlapConnection olapConnection = + tester.getWrapper().unwrap(connection, OlapConnection.class); + Cube warehouseSalesCube = + olapConnection + .getOlapCatalogs() + .get("FoodMart") + .getSchemas() + .get("FoodMart") + .getCubes() + .get("Warehouse and Sales"); + Set measureVcNameSet = new HashSet(); + for (Measure measure : warehouseSalesCube.getMeasures()) { + measureVcNameSet.add(measure.getName()); + } + assertEquals( + new HashSet( + Arrays.asList( + "Sales Count", + "Store Cost", + "Store Sales", + "Unit Sales", + "Profit", + "Profit Growth", + "Store Invoice", + "Supply Time", + "Units Ordered", + "Units Shipped", + "Warehouse Cost", + "Warehouse Profit", + "Warehouse Sales", + "Average Warehouse Sale")), + measureVcNameSet); + } + /** * Testcase for bug 1868075, "Query on ragged hierarchy gives only empty * cells".