From d5ff50dec8f16ff5952255b239adbd0f006fc4bb Mon Sep 17 00:00:00 2001 From: Luc Boudreau Date: Wed, 1 Aug 2012 17:37:25 +0000 Subject: [PATCH] First round of fixes for Mondrian 4 compatibility. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@542 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- testsrc/org/olap4j/CellSetFormatterTest.java | 96 +++--- testsrc/org/olap4j/ConnectionTest.java | 176 +++++----- testsrc/org/olap4j/MetadataTest.java | 36 +- testsrc/org/olap4j/OlapTest.java | 320 +++++++++--------- .../org/olap4j/transform/TransformTest.java | 4 +- 5 files changed, 321 insertions(+), 311 deletions(-) diff --git a/testsrc/org/olap4j/CellSetFormatterTest.java b/testsrc/org/olap4j/CellSetFormatterTest.java index 0b36ec3..779d03d 100644 --- a/testsrc/org/olap4j/CellSetFormatterTest.java +++ b/testsrc/org/olap4j/CellSetFormatterTest.java @@ -155,14 +155,14 @@ public void testQuery1Traditional() throws SQLException { "Axis #0:\n" + "{}\n" + "Axis #1:\n" - + "{[Time].[1997].[Q1], [Measures].[Unit Sales]}\n" - + "{[Time].[1997].[Q1], [Measures].[Store Sales]}\n" - + "{[Time].[1997].[Q2].[4], [Measures].[Unit Sales]}\n" - + "{[Time].[1997].[Q2].[4], [Measures].[Store Sales]}\n" + + "{[Time].[Time].[1997].[Q1], [Measures].[Unit Sales]}\n" + + "{[Time].[Time].[1997].[Q1], [Measures].[Store Sales]}\n" + + "{[Time].[Time].[1997].[Q2].[4], [Measures].[Unit Sales]}\n" + + "{[Time].[Time].[1997].[Q2].[4], [Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Store].[USA].[CA].[Los Angeles]}\n" - + "{[Store].[USA].[WA].[Seattle]}\n" - + "{[Store].[USA].[CA].[San Francisco]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles]}\n" + + "{[Store].[Store].[USA].[WA].[Seattle]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco]}\n" + "Row #0: 6,373\n" + "Row #0: 13,736.97\n" + "Row #0: 1,865\n" @@ -351,13 +351,13 @@ public void testFilter() throws SQLException { queryString, Format.TRADITIONAL, "Axis #0:\n" - + "{[Gender].[M], [Marital Status].[S]}\n" + + "{[Gender].[Gender].[M], [Marital Status].[Marital Status].[S]}\n" + "Axis #1:\n" - + "{[Time].[1997].[Q1], [Measures].[Unit Sales]}\n" - + "{[Time].[1997].[Q2].[4], [Measures].[Unit Sales]}\n" + + "{[Time].[Time].[1997].[Q1], [Measures].[Unit Sales]}\n" + + "{[Time].[Time].[1997].[Q2].[4], [Measures].[Unit Sales]}\n" + "Axis #2:\n" - + "{[Store].[USA].[CA].[Los Angeles]}\n" - + "{[Store].[USA].[CA].[San Francisco]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco]}\n" + "Row #0: 1,615\n" + "Row #0: 594\n" + "Row #1: 101\n" @@ -403,18 +403,18 @@ public void testFilterCompound() throws SQLException { queryString, Format.TRADITIONAL, "Axis #0:\n" - + "{[Gender].[F], [Marital Status].[All Marital Status]}\n" - + "{[Gender].[F], [Marital Status].[M]}\n" - + "{[Gender].[F], [Marital Status].[S]}\n" - + "{[Gender].[M], [Marital Status].[All Marital Status]}\n" - + "{[Gender].[M], [Marital Status].[M]}\n" - + "{[Gender].[M], [Marital Status].[S]}\n" + + "{[Gender].[Gender].[F], [Marital Status].[Marital Status].[All Marital Status]}\n" + + "{[Gender].[Gender].[F], [Marital Status].[Marital Status].[M]}\n" + + "{[Gender].[Gender].[F], [Marital Status].[Marital Status].[S]}\n" + + "{[Gender].[Gender].[M], [Marital Status].[Marital Status].[All Marital Status]}\n" + + "{[Gender].[Gender].[M], [Marital Status].[Marital Status].[M]}\n" + + "{[Gender].[Gender].[M], [Marital Status].[Marital Status].[S]}\n" + "Axis #1:\n" - + "{[Time].[1997].[Q1], [Measures].[Unit Sales]}\n" - + "{[Time].[1997].[Q2].[4], [Measures].[Unit Sales]}\n" + + "{[Time].[Time].[1997].[Q1], [Measures].[Unit Sales]}\n" + + "{[Time].[Time].[1997].[Q2].[4], [Measures].[Unit Sales]}\n" + "Axis #2:\n" - + "{[Store].[USA].[CA].[Los Angeles]}\n" - + "{[Store].[USA].[CA].[San Francisco]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco]}\n" + "Row #0: 6,373\n" + "Row #0: 1,865\n" + "Row #1: 439\n" @@ -465,7 +465,7 @@ public void testThreeAxes() throws SQLException { + "FROM [Sales]", Format.RECTANGULAR, "\n" - + "PAGES: [Product].[Drink]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -477,7 +477,7 @@ public void testThreeAxes() throws SQLException { + "| | | | Los Angeles | 650 | 1,267.04 | 141 | 289.16 |\n" + "| | | WA | | 2,679 | 5,106.36 | 1,007 | 1,978.99 |\n" + "\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -504,8 +504,8 @@ public void testFourAxes() throws SQLException { + "WHERE [Measures].[Store Sales]", Format.RECTANGULAR, "\n" - + "CHAPTERS: [Marital Status].[All Marital Status], [Gender].[F]\n" - + "PAGES: [Product].[Drink]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[All Marital Status], [Gender].[Gender].[F]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -513,8 +513,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 5,676.21 | 1,836.80 |\n" + "| | OR | 1,569.00 | 327.26 |\n" + "\n" - + "CHAPTERS: [Marital Status].[All Marital Status], [Gender].[F]\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[All Marital Status], [Gender].[Gender].[F]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -522,8 +522,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 3,873.00 | 1,378.20 |\n" + "| | OR | 1,069.88 | 284.91 |\n" + "\n" - + "CHAPTERS: [Marital Status].[All Marital Status], [Gender].[M]\n" - + "PAGES: [Product].[Drink]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[All Marital Status], [Gender].[Gender].[M]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -531,8 +531,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 5,909.59 | 2,047.73 |\n" + "| | OR | 1,600.69 | 365.50 |\n" + "\n" - + "CHAPTERS: [Marital Status].[All Marital Status], [Gender].[M]\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[All Marital Status], [Gender].[Gender].[M]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -540,8 +540,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 3,835.75 | 1,134.60 |\n" + "| | OR | 1,089.06 | 230.57 |\n" + "\n" - + "CHAPTERS: [Marital Status].[M], [Gender].[F]\n" - + "PAGES: [Product].[Drink]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[M], [Gender].[Gender].[F]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -549,8 +549,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 3,099.69 | 971.79 |\n" + "| | OR | 767.62 | 134.02 |\n" + "\n" - + "CHAPTERS: [Marital Status].[M], [Gender].[F]\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[M], [Gender].[Gender].[F]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -558,8 +558,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 2,125.13 | 732.95 |\n" + "| | OR | 581.31 | 160.55 |\n" + "\n" - + "CHAPTERS: [Marital Status].[M], [Gender].[M]\n" - + "PAGES: [Product].[Drink]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[M], [Gender].[Gender].[M]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -567,8 +567,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 2,874.11 | 914.70 |\n" + "| | OR | 643.61 | 132.37 |\n" + "\n" - + "CHAPTERS: [Marital Status].[M], [Gender].[M]\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[M], [Gender].[Gender].[M]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -576,8 +576,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 1,920.54 | 528.54 |\n" + "| | OR | 519.94 | 108.96 |\n" + "\n" - + "CHAPTERS: [Marital Status].[S], [Gender].[F]\n" - + "PAGES: [Product].[Drink]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[S], [Gender].[Gender].[F]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -585,8 +585,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 2,576.52 | 865.01 |\n" + "| | OR | 801.38 | 193.24 |\n" + "\n" - + "CHAPTERS: [Marital Status].[S], [Gender].[F]\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[S], [Gender].[Gender].[F]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -594,8 +594,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 1,747.87 | 645.25 |\n" + "| | OR | 488.57 | 124.36 |\n" + "\n" - + "CHAPTERS: [Marital Status].[S], [Gender].[M]\n" - + "PAGES: [Product].[Drink]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[S], [Gender].[Gender].[M]\n" + + "PAGES: [Product].[Product].[Drink]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" @@ -603,8 +603,8 @@ public void testFourAxes() throws SQLException { + "| USA | | 3,035.48 | 1,133.03 |\n" + "| | OR | 957.08 | 233.13 |\n" + "\n" - + "CHAPTERS: [Marital Status].[S], [Gender].[M]\n" - + "PAGES: [Product].[Food].[Dairy]\n" + + "CHAPTERS: [Marital Status].[Marital Status].[S], [Gender].[Gender].[M]\n" + + "PAGES: [Product].[Product].[Food].[Dairy]\n" + "| | 1997 |\n" + "| | Q1 | Q2 |\n" + "| | | 4 |\n" diff --git a/testsrc/org/olap4j/ConnectionTest.java b/testsrc/org/olap4j/ConnectionTest.java index 295f8a4..d74fd84 100644 --- a/testsrc/org/olap4j/ConnectionTest.java +++ b/testsrc/org/olap4j/ConnectionTest.java @@ -785,13 +785,15 @@ public void testPreparedStatement() throws SQLException { case TypeName: String typeName = parameterMetaData.getParameterTypeName(paramIndex); - assertEquals("MemberType", typeName); + assertEquals( + "MemberType", + typeName); break; case OlapType: Type olapType = parameterMetaData.getParameterOlapType(paramIndex); assertEquals( - "MemberType", + "MemberType", olapType.toString()); break; default: @@ -824,14 +826,14 @@ public void testPreparedStatement() throws SQLException { String s = TestContext.toString(cellSet); final String expected = "Axis #0:\n" - + "{[Gender].[M]}\n" + + "{[Gender].[Gender].[M]}\n" + "Axis #1:\n" - + "{[Store].[USA]}\n" - + "{[Store].[USA].[CA].[Alameda]}\n" - + "{[Store].[USA].[CA].[Beverly Hills]}\n" - + "{[Store].[USA].[CA].[Los Angeles]}\n" - + "{[Store].[USA].[CA].[San Diego]}\n" - + "{[Store].[USA].[CA].[San Francisco]}\n" + + "{[Store].[Store].[USA]}\n" + + "{[Store].[Store].[USA].[CA].[Alameda]}\n" + + "{[Store].[Store].[USA].[CA].[Beverly Hills]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles]}\n" + + "{[Store].[Store].[USA].[CA].[San Diego]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco]}\n" + "Row #0: 135,215\n" + "Row #0: \n" + "Row #0: 10,562\n" @@ -862,10 +864,10 @@ public void testPreparedStatement() throws SQLException { s = TestContext.toString(cellSet2); final String expected2 = "Axis #0:\n" - + "{[Gender].[M]}\n" + + "{[Gender].[Gender].[M]}\n" + "Axis #1:\n" - + "{[Store].[USA].[CA]}\n" - + "{[Store].[USA].[CA].[San Francisco].[Store 14]}\n" + + "{[Store].[Store].[USA].[CA]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco].[Store 14]}\n" + "Row #0: 37,989\n" + "Row #0: 1,053\n"; TestContext.assertEqualsVerbose(expected2, s); @@ -878,10 +880,10 @@ public void testPreparedStatement() throws SQLException { // Re-execute with a new MDX string. CellSet cellSet3 = pstmt.executeOlapQuery( - "SELECT FROM [Sales] WHERE [Time.Weekly].[1997].[3]"); + "SELECT FROM [Sales] WHERE [Time].[Weekly].[1997].[3]"); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time.Weekly].[1997].[3]}\n" + + "{[Time].[Weekly].[1997].[3]}\n" + "9,518", TestContext.toString(cellSet3)); @@ -910,13 +912,13 @@ public void testPreparedStatement() throws SQLException { SelectNode select = mdxParser.parseSelect( "select {[Gender]} on columns from [sales]\n" - + "where [Time].[1997].[Q4]"); + + "where [Time].[Time].[1997].[Q4]"); CellSet cellSet5 = pstmt.executeOlapQuery(select); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q4]}\n" + + "{[Time].[Time].[1997].[Q4]}\n" + "Axis #1:\n" - + "{[Gender].[All Gender]}\n" + + "{[Gender].[Gender].[All Gender]}\n" + "Row #0: 72,024\n", TestContext.toString(cellSet5)); @@ -1114,14 +1116,14 @@ public void testCellSet() throws SQLException { String s = TestContext.toString(cellSet); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q2]}\n" + + "{[Time].[Time].[1997].[Q2]}\n" + "Axis #1:\n" + "{[Measures].[Unit Sales]}\n" + "{[Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Gender].[M], [Product].[Drink]}\n" - + "{[Gender].[M], [Product].[Food]}\n" - + "{[Gender].[M], [Product].[Non-Consumable]}\n" + + "{[Gender].[Gender].[M], [Product].[Product].[Drink]}\n" + + "{[Gender].[Gender].[M], [Product].[Product].[Food]}\n" + + "{[Gender].[Gender].[M], [Product].[Product].[Non-Consumable]}\n" + "Row #0: 3,023\n" + "Row #0: 6,004.80\n" + "Row #1: 22,558\n" @@ -1626,7 +1628,7 @@ public void testCubeLookupMember() throws Exception { Member member = cube.lookupMember(nameList("Time", "1997", "Q2")); - assertEquals("[Time].[1997].[Q2]", member.getUniqueName()); + assertEquals("[Time].[Time].[1997].[Q2]", member.getUniqueName()); // Member.getChildMemberCount assertEquals(3, member.getChildMemberCount()); @@ -1636,10 +1638,12 @@ public void testCubeLookupMember() throws Exception { member.getChildMembers(); assertEquals(3, childMembers.size()); assertEquals( - "[Time].[1997].[Q2].[4]", childMembers.get(0).getUniqueName()); + "[Time].[Time].[1997].[Q2].[4]", + childMembers.get(0).getUniqueName()); assertEquals(0, childMembers.get(0).getChildMemberCount()); assertEquals( - "[Time].[1997].[Q2].[6]", childMembers.get("6").getUniqueName()); + "[Time].[Time].[1997].[Q2].[6]", + childMembers.get("6").getUniqueName()); assertNull(childMembers.get("1")); member = @@ -1695,10 +1699,10 @@ public void testCubeLookupMembers() throws Exception { break; default: expected = - "[Time].[1997]\n" - + "[Time].[1997].[Q2].[4]\n" - + "[Time].[1997].[Q2].[5]\n" - + "[Time].[1997].[Q2].[6]\n"; + "[Time].[Time].[1997]\n" + + "[Time].[Time].[1997].[Q2].[4]\n" + + "[Time].[Time].[1997].[Q2].[5]\n" + + "[Time].[Time].[1997].[Q2].[6]\n"; } TestContext.assertEqualsVerbose( expected, @@ -1719,7 +1723,7 @@ public void testCubeLookupMembers() throws Exception { Member.TreeOp.ANCESTORS, Member.TreeOp.PARENT), nameList("Time", "1997", "Q2")); TestContext.assertEqualsVerbose( - "[Time].[1997]\n", + "[Time].[Time].[1997]\n", memberListToString(memberList)); // ask for parent of root member, should not get null member in list @@ -1743,21 +1747,21 @@ public void testCubeLookupMembers() throws Exception { // TODO: fix mondrian's XMLA driver to return members ordered by // level then ordinal expected = - "[Time].[1997].[Q2].[4]\n" - + "[Time].[1997].[Q2].[5]\n" - + "[Time].[1997].[Q2].[6]\n" - + "[Time].[1997].[Q1]\n" - + "[Time].[1997].[Q3]\n" - + "[Time].[1997].[Q4]\n"; + "[Time].[Time].[1997].[Q2].[4]\n" + + "[Time].[Time].[1997].[Q2].[5]\n" + + "[Time].[Time].[1997].[Q2].[6]\n" + + "[Time].[Time].[1997].[Q1]\n" + + "[Time].[Time].[1997].[Q3]\n" + + "[Time].[Time].[1997].[Q4]\n"; break; default: expected = - "[Time].[1997].[Q1]\n" - + "[Time].[1997].[Q2].[4]\n" - + "[Time].[1997].[Q2].[5]\n" - + "[Time].[1997].[Q2].[6]\n" - + "[Time].[1997].[Q3]\n" - + "[Time].[1997].[Q4]\n"; + "[Time].[Time].[1997].[Q1]\n" + + "[Time].[Time].[1997].[Q2].[4]\n" + + "[Time].[Time].[1997].[Q2].[5]\n" + + "[Time].[Time].[1997].[Q2].[6]\n" + + "[Time].[Time].[1997].[Q3]\n" + + "[Time].[Time].[1997].[Q4]\n"; break; } TestContext.assertEqualsVerbose( @@ -1770,7 +1774,7 @@ public void testCubeLookupMembers() throws Exception { Olap4jUtil.enumSetOf(Member.TreeOp.SIBLINGS), nameList("Time", "1997")); TestContext.assertEqualsVerbose( - "[Time].[1998]\n", + "[Time].[Time].[1998]\n", memberListToString(memberList)); memberList = @@ -1779,9 +1783,9 @@ public void testCubeLookupMembers() throws Exception { Member.TreeOp.SIBLINGS, Member.TreeOp.SELF), nameList("Customers", "USA", "OR")); TestContext.assertEqualsVerbose( - "[Customers].[USA].[CA]\n" - + "[Customers].[USA].[OR]\n" - + "[Customers].[USA].[WA]\n", + "[Customers].[Customers].[USA].[CA]\n" + + "[Customers].[Customers].[USA].[OR]\n" + + "[Customers].[Customers].[USA].[WA]\n", memberListToString(memberList)); } @@ -1905,7 +1909,7 @@ public void testMetadata() throws Exception { // Look for the Time.Weekly hierarchy, the 2nd hierarchy in the Time // dimension. final Hierarchy timeWeeklyHierarchy = - cube.getHierarchies().get("Time.Weekly"); + cube.getHierarchies().get("Weekly"); assertNotNull(timeWeeklyHierarchy); assertEquals("Time", timeWeeklyHierarchy.getDimension().getName()); assertEquals( @@ -1957,22 +1961,27 @@ public void testMetadata() throws Exception { cube.lookupMember( nameList("Product", "Food", "Baked Goods", "Bread")); - assertEquals("[Product].[Food]", member.getUniqueName()); + assertEquals("[Product].[Product].[Food]", member.getUniqueName()); assertEquals("Food", member.getName()); assertEquals( - "[Product].[Product Family]", + "[Product].[Product].[Product Family]", member.getLevel().getUniqueName()); assertEquals(Member.Type.REGULAR, member.getMemberType()); assertEquals( - "[Product].[Food].[Baked Goods]", + "[Product].[Product].[Food].[Baked Goods]", bread.getParentMember().getUniqueName()); final List list = bread.getAncestorMembers(); assertEquals(3, list.size()); assertEquals( - "[Product].[Food].[Baked Goods]", list.get(0).getUniqueName()); - assertEquals("[Product].[Food]", list.get(1).getUniqueName()); - assertEquals("[Product].[All Products]", list.get(2).getUniqueName()); + "[Product].[Product].[Food].[Baked Goods]", + list.get(0).getUniqueName()); + assertEquals( + "[Product].[Product].[Food]", + list.get(1).getUniqueName()); + assertEquals( + "[Product].[Product].[All Products]", + list.get(2).getUniqueName()); assertEquals("Food", member.getCaption()); @@ -2002,11 +2011,12 @@ public void testMetadata() throws Exception { // All member final Member allProductsMember = member.getParentMember(); assertEquals( - "[Product].[All Products]", + "[Product].[Product].[All Products]", allProductsMember.getUniqueName()); assertEquals("(All)", allProductsMember.getLevel().getName()); assertEquals( - "[Product].[(All)]", allProductsMember.getLevel().getUniqueName()); + "[Product].[Product].[(All)]", + allProductsMember.getLevel().getUniqueName()); assertEquals(1, allProductsMember.getLevel().getMembers().size()); assertTrue(allProductsMember.isAll()); assertNull(allProductsMember.getParentMember()); @@ -2034,10 +2044,10 @@ public void testMetadata() throws Exception { assertNull( allProductsMember.getPropertyValue(parentUniqueNameProperty)); assertEquals( - "[Product].[All Products]", + "[Product].[Product].[All Products]", member.getPropertyValue(parentUniqueNameProperty)); assertEquals( - "[Product].[Food].[Baked Goods]", + "[Product].[Product].[Food].[Baked Goods]", bread.getPropertyValue(parentUniqueNameProperty)); // Measures @@ -2190,21 +2200,21 @@ public void testRagged() throws SQLException { "Axis #0:\n" + "{}\n" + "Axis #1:\n" - + "{[Product].[Drink].[Alcoholic Beverages].[Beer and Wine]}\n" - + "{[Product].[Food].[Baked Goods].[Bread]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages].[Beer and Wine]}\n" + + "{[Product].[Product].[Food].[Baked Goods].[Bread]}\n" + "Axis #2:\n" - + "{[Store].[USA].[CA].[Alameda], [Time].[1997].[Q1].[1]}\n" - + "{[Store].[USA].[CA].[Alameda], [Time].[1997].[Q1].[2]}\n" - + "{[Store].[USA].[CA].[Alameda], [Time].[1997].[Q1].[3]}\n" - + "{[Store].[USA].[CA].[Beverly Hills], [Time].[1997].[Q1].[1]}\n" - + "{[Store].[USA].[CA].[Beverly Hills], [Time].[1997].[Q1].[2]}\n" - + "{[Store].[USA].[CA].[Beverly Hills], [Time].[1997].[Q1].[3]}\n" - + "{[Store].[USA].[CA].[Los Angeles], [Time].[1997].[Q1].[1]}\n" - + "{[Store].[USA].[CA].[Los Angeles], [Time].[1997].[Q1].[2]}\n" - + "{[Store].[USA].[CA].[Los Angeles], [Time].[1997].[Q1].[3]}\n" - + "{[Store].[USA].[CA].[San Francisco], [Time].[1997].[Q1].[1]}\n" - + "{[Store].[USA].[CA].[San Francisco], [Time].[1997].[Q1].[2]}\n" - + "{[Store].[USA].[CA].[San Francisco], [Time].[1997].[Q1].[3]}\n" + + "{[Store].[Store].[USA].[CA].[Alameda], [Time].[Time].[1997].[Q1].[1]}\n" + + "{[Store].[Store].[USA].[CA].[Alameda], [Time].[Time].[1997].[Q1].[2]}\n" + + "{[Store].[Store].[USA].[CA].[Alameda], [Time].[Time].[1997].[Q1].[3]}\n" + + "{[Store].[Store].[USA].[CA].[Beverly Hills], [Time].[Time].[1997].[Q1].[1]}\n" + + "{[Store].[Store].[USA].[CA].[Beverly Hills], [Time].[Time].[1997].[Q1].[2]}\n" + + "{[Store].[Store].[USA].[CA].[Beverly Hills], [Time].[Time].[1997].[Q1].[3]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles], [Time].[Time].[1997].[Q1].[1]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles], [Time].[Time].[1997].[Q1].[2]}\n" + + "{[Store].[Store].[USA].[CA].[Los Angeles], [Time].[Time].[1997].[Q1].[3]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco], [Time].[Time].[1997].[Q1].[1]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco], [Time].[Time].[1997].[Q1].[2]}\n" + + "{[Store].[Store].[USA].[CA].[San Francisco], [Time].[Time].[1997].[Q1].[3]}\n" + "Row #0: \n" + "Row #0: \n" + "Row #1: \n" @@ -2451,7 +2461,7 @@ public void testAxisType() throws Throwable { final Type filterType = filterAxis.getExpression().getType(); assertTrue(filterType instanceof TupleType); assertEquals( - "TupleType, MemberType>", + "TupleType, MemberType>", filterType.toString()); } @@ -2738,15 +2748,15 @@ public void testCellSetWithCalcMember() throws SQLException { + "WHERE ([Time.Weekly].[Week].[5])"); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time.Weekly].[1997].[5]}\n" + + "{[Time].[Weekly].[1997].[5]}\n" + "Axis #1:\n" + "{[Measures].[Average Profit]}\n" + "Axis #2:\n" - + "{[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Good]}\n" - + "{[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Pearl]}\n" - + "{[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Portsmouth]}\n" - + "{[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Top Measure]}\n" - + "{[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Walrus]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Good]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Pearl]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Portsmouth]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Top Measure]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Walrus]}\n" + "Row #0: $2.17\n" + "Row #1: $2.60\n" + "Row #2: $6.03\n" @@ -2801,13 +2811,13 @@ private void buildQuery( "Axis #0:\n" + "{}\n" + "Axis #1:\n" - + "{[Gender].[All Gender]}\n" - + "{[Gender].[F]}\n" - + "{[Gender].[M]}\n" + + "{[Gender].[Gender].[All Gender]}\n" + + "{[Gender].[Gender].[F]}\n" + + "{[Gender].[Gender].[M]}\n" + "Axis #2:\n" - + "{[Customers].[USA].[CA]}\n" - + "{[Customers].[USA].[OR]}\n" - + "{[Customers].[USA].[WA]}\n" + + "{[Customers].[Customers].[USA].[CA]}\n" + + "{[Customers].[Customers].[USA].[OR]}\n" + + "{[Customers].[Customers].[USA].[WA]}\n" + "Row #0: 74,748\n" + "Row #0: 36,759\n" + "Row #0: 37,989\n" diff --git a/testsrc/org/olap4j/MetadataTest.java b/testsrc/org/olap4j/MetadataTest.java index d469e0b..e6a8123 100644 --- a/testsrc/org/olap4j/MetadataTest.java +++ b/testsrc/org/olap4j/MetadataTest.java @@ -707,34 +707,34 @@ public void testDatabaseMetaDataGetMeasures() throws SQLException { public void testDatabaseMetaDataGetMembers() throws SQLException { String s = checkResultSet( olapDatabaseMetaData.getMembers( - catalogName, "FoodMart", "Sales", null, "[Gender]", null, null, - null), + catalogName, "FoodMart", "Sales", null, "[Gender].[Gender]", + null, null, null), MEMBERS_COLUMN_NAMES); TestContext.assertEqualsVerbose( "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Gender], HIERARCHY_UNIQUE_NAME=[Gender], LEVEL_UNIQUE_NAME=[Gender].[(All)], LEVEL_NUMBER=0, MEMBER_ORDINAL=0, MEMBER_NAME=All Gender, MEMBER_UNIQUE_NAME=[Gender].[All Gender], MEMBER_TYPE=2, MEMBER_GUID=null, MEMBER_CAPTION=All Gender, CHILDREN_CARDINALITY=2, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=null, PARENT_COUNT=0, TREE_OP=null, DEPTH=0\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Gender], HIERARCHY_UNIQUE_NAME=[Gender].[Gender], LEVEL_UNIQUE_NAME=[Gender].[Gender].[(All)], LEVEL_NUMBER=0, MEMBER_ORDINAL=0, MEMBER_NAME=All Gender, MEMBER_UNIQUE_NAME=[Gender].[Gender].[All Gender], MEMBER_TYPE=2, MEMBER_GUID=null, MEMBER_CAPTION=All Gender, CHILDREN_CARDINALITY=2, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=null, PARENT_COUNT=0, TREE_OP=null, DEPTH=0\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Gender], HIERARCHY_UNIQUE_NAME=[Gender], LEVEL_UNIQUE_NAME=[Gender].[Gender], LEVEL_NUMBER=1, MEMBER_ORDINAL=1, MEMBER_NAME=F, MEMBER_UNIQUE_NAME=[Gender].[F], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=F, CHILDREN_CARDINALITY=0, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Gender].[All Gender], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Gender], HIERARCHY_UNIQUE_NAME=[Gender].[Gender], LEVEL_UNIQUE_NAME=[Gender].[Gender].[Gender], LEVEL_NUMBER=1, MEMBER_ORDINAL=1, MEMBER_NAME=F, MEMBER_UNIQUE_NAME=[Gender].[Gender].[F], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=F, CHILDREN_CARDINALITY=0, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Gender].[Gender].[All Gender], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Gender], HIERARCHY_UNIQUE_NAME=[Gender], LEVEL_UNIQUE_NAME=[Gender].[Gender], LEVEL_NUMBER=1, MEMBER_ORDINAL=2, MEMBER_NAME=M, MEMBER_UNIQUE_NAME=[Gender].[M], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=M, CHILDREN_CARDINALITY=0, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Gender].[All Gender], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n", + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Gender], HIERARCHY_UNIQUE_NAME=[Gender].[Gender], LEVEL_UNIQUE_NAME=[Gender].[Gender].[Gender], LEVEL_NUMBER=1, MEMBER_ORDINAL=2, MEMBER_NAME=M, MEMBER_UNIQUE_NAME=[Gender].[Gender].[M], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=M, CHILDREN_CARDINALITY=0, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Gender].[Gender].[All Gender], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n", s); // by member unique name s = checkResultSet( olapDatabaseMetaData.getMembers( catalogName, "FoodMart", "Sales", null, null, null, - "[Time].[1997].[Q2].[4]", null), + "[Time].[Time].[1997].[Q2].[4]", null), MEMBERS_COLUMN_NAMES); TestContext.assertEqualsVerbose( "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Time], HIERARCHY_UNIQUE_NAME=[Time], LEVEL_UNIQUE_NAME=[Time].[Month], LEVEL_NUMBER=2, MEMBER_ORDINAL=6, MEMBER_NAME=4, MEMBER_UNIQUE_NAME=[Time].[1997].[Q2].[4], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=4, CHILDREN_CARDINALITY=0, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Time].[1997].[Q2], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n", + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Time], HIERARCHY_UNIQUE_NAME=[Time].[Time], LEVEL_UNIQUE_NAME=[Time].[Time].[Month], LEVEL_NUMBER=2, MEMBER_ORDINAL=6, MEMBER_NAME=4, MEMBER_UNIQUE_NAME=[Time].[Time].[1997].[Q2].[4], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=4, CHILDREN_CARDINALITY=0, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Time].[Time].[1997].[Q2], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n", s); // with treeop s = checkResultSet( olapDatabaseMetaData.getMembers( catalogName, "FoodMart", "Sales", null, null, null, - "[Customers].[USA].[CA]", + "[Customers].[Customers].[USA].[CA]", Olap4jUtil.enumSetOf( Member.TreeOp.ANCESTORS, Member.TreeOp.SIBLINGS)), MEMBERS_COLUMN_NAMES); @@ -744,25 +744,25 @@ public void testDatabaseMetaDataGetMembers() throws SQLException { // by level depth TestContext.assertEqualsVerbose( "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=7235, MEMBER_NAME=OR, MEMBER_UNIQUE_NAME=[Customers].[USA].[OR], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=OR, CHILDREN_CARDINALITY=11, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=7235, MEMBER_NAME=OR, MEMBER_UNIQUE_NAME=[Customers].[Customers].[USA].[OR], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=OR, CHILDREN_CARDINALITY=11, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=8298, MEMBER_NAME=WA, MEMBER_UNIQUE_NAME=[Customers].[USA].[WA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=WA, CHILDREN_CARDINALITY=22, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=8298, MEMBER_NAME=WA, MEMBER_UNIQUE_NAME=[Customers].[Customers].[USA].[WA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=WA, CHILDREN_CARDINALITY=22, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[Country], LEVEL_NUMBER=1, MEMBER_ORDINAL=2966, MEMBER_NAME=USA, MEMBER_UNIQUE_NAME=[Customers].[USA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=USA, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Customers].[All Customers], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[Country], LEVEL_NUMBER=1, MEMBER_ORDINAL=2966, MEMBER_NAME=USA, MEMBER_UNIQUE_NAME=[Customers].[Customers].[USA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=USA, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Customers].[Customers].[All Customers], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[(All)], LEVEL_NUMBER=0, MEMBER_ORDINAL=0, MEMBER_NAME=All Customers, MEMBER_UNIQUE_NAME=[Customers].[All Customers], MEMBER_TYPE=2, MEMBER_GUID=null, MEMBER_CAPTION=All Customers, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=null, PARENT_COUNT=0, TREE_OP=null, DEPTH=0\n", + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[(All)], LEVEL_NUMBER=0, MEMBER_ORDINAL=0, MEMBER_NAME=All Customers, MEMBER_UNIQUE_NAME=[Customers].[Customers].[All Customers], MEMBER_TYPE=2, MEMBER_GUID=null, MEMBER_CAPTION=All Customers, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=null, PARENT_COUNT=0, TREE_OP=null, DEPTH=0\n", s); break; default: TestContext.assertEqualsVerbose( "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[(All)], LEVEL_NUMBER=0, MEMBER_ORDINAL=0, MEMBER_NAME=All Customers, MEMBER_UNIQUE_NAME=[Customers].[All Customers], MEMBER_TYPE=2, MEMBER_GUID=null, MEMBER_CAPTION=All Customers, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=null, PARENT_COUNT=0, TREE_OP=null, DEPTH=0\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[(All)], LEVEL_NUMBER=0, MEMBER_ORDINAL=0, MEMBER_NAME=All Customers, MEMBER_UNIQUE_NAME=[Customers].[Customers].[All Customers], MEMBER_TYPE=2, MEMBER_GUID=null, MEMBER_CAPTION=All Customers, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=null, PARENT_COUNT=0, TREE_OP=null, DEPTH=0\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[Country], LEVEL_NUMBER=1, MEMBER_ORDINAL=2966, MEMBER_NAME=USA, MEMBER_UNIQUE_NAME=[Customers].[USA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=USA, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Customers].[All Customers], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[Country], LEVEL_NUMBER=1, MEMBER_ORDINAL=2966, MEMBER_NAME=USA, MEMBER_UNIQUE_NAME=[Customers].[Customers].[USA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=USA, CHILDREN_CARDINALITY=3, PARENT_LEVEL=0, PARENT_UNIQUE_NAME=[Customers].[Customers].[All Customers], PARENT_COUNT=1, TREE_OP=null, DEPTH=1\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=7235, MEMBER_NAME=OR, MEMBER_UNIQUE_NAME=[Customers].[USA].[OR], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=OR, CHILDREN_CARDINALITY=11, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n" + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=7235, MEMBER_NAME=OR, MEMBER_UNIQUE_NAME=[Customers].[Customers].[USA].[OR], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=OR, CHILDREN_CARDINALITY=11, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n" + "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers], LEVEL_UNIQUE_NAME=[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=8298, MEMBER_NAME=WA, MEMBER_UNIQUE_NAME=[Customers].[USA].[WA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=WA, CHILDREN_CARDINALITY=22, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n", + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Sales, DIMENSION_UNIQUE_NAME=[Customers], HIERARCHY_UNIQUE_NAME=[Customers].[Customers], LEVEL_UNIQUE_NAME=[Customers].[Customers].[State Province], LEVEL_NUMBER=2, MEMBER_ORDINAL=8298, MEMBER_NAME=WA, MEMBER_UNIQUE_NAME=[Customers].[Customers].[USA].[WA], MEMBER_TYPE=1, MEMBER_GUID=null, MEMBER_CAPTION=WA, CHILDREN_CARDINALITY=22, PARENT_LEVEL=1, PARENT_UNIQUE_NAME=[Customers].[Customers].[USA], PARENT_COUNT=1, TREE_OP=null, DEPTH=2\n", s); break; } @@ -775,7 +775,9 @@ public void testDatabaseMetaDataGetSets() throws SQLException { SETS_COLUMN_NAMES); TestContext.assertEqualsVerbose( "CATALOG_NAME=" + catalogName - + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Warehouse, SET_NAME=[Top Sellers], SCOPE=1\n", + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Warehouse, SET_NAME=[Top Sellers], SCOPE=1\n" + + "CATALOG_NAME=" + catalogName + + ", SCHEMA_NAME=FoodMart, CUBE_NAME=Warehouse and Sales, SET_NAME=[Top Sellers], SCOPE=1\n", s); s = checkResultSet( diff --git a/testsrc/org/olap4j/OlapTest.java b/testsrc/org/olap4j/OlapTest.java index d57c925..59bab6d 100644 --- a/testsrc/org/olap4j/OlapTest.java +++ b/testsrc/org/olap4j/OlapTest.java @@ -221,7 +221,7 @@ public void testSelectionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{[Product].[Drink].Children} ON ROWS\n" + + "{[Product].[Product].[Drink].Children} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -238,7 +238,7 @@ public void testSelectionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{Ascendants([Product].[Drink])} ON ROWS\n" + + "{Ascendants([Product].[Product].[Drink])} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -255,7 +255,7 @@ public void testSelectionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{Descendants([Product].[Drink])} ON ROWS\n" + + "{Descendants([Product].[Product].[Drink])} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -273,7 +273,7 @@ public void testSelectionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{{[Product].[Drink], [Product].[Drink].Children}} ON ROWS\n" + + "{{[Product].[Product].[Drink], [Product].[Product].[Drink].Children}} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -290,7 +290,7 @@ public void testSelectionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{[Product].[Drink].Siblings} ON ROWS\n" + + "{[Product].[Product].[Drink].Siblings} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -308,7 +308,7 @@ public void testSelectionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{[Product].[Drink].Siblings, [Product].[Product Department].Members} ON ROWS\n" + + "{[Product].[Product].[Drink].Siblings, [Product].[Product].[Product Department].Members} ON ROWS\n" + "FROM [Sales]", mdxString); } @@ -348,11 +348,9 @@ public void testMultipleDimensionSelections() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "CrossJoin([Product].[Drink].Children, " - + "CrossJoin({[Store].[USA], " - + "[Store].[USA].Children}, " - + "[Time].[1997].Children)) ON ROWS\n" - + "FROM [Sales]", mdxString); + + "CrossJoin([Product].[Product].[Drink].Children, CrossJoin({[Store].[Store].[USA], [Store].[Store].[USA].Children}, [Time].[Time].[1997].Children)) ON ROWS\n" + + "FROM [Sales]", + mdxString); } public void testSwapAxes() throws Exception { @@ -388,7 +386,7 @@ public void testSwapAxes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{[Product].[Drink].Children} ON ROWS\n" + + "{[Product].[Product].[Drink].Children} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -405,7 +403,7 @@ public void testSwapAxes() throws Exception { mdxString = mdx.toString(); TestContext.assertEqualsVerbose( "SELECT\n" - + "{[Product].[Drink].Children} ON COLUMNS,\n" + + "{[Product].[Product].[Drink].Children} ON COLUMNS,\n" + "{[Measures].[Store Sales]} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -451,9 +449,9 @@ public void testSortDimension() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{{[Product].[Drink], [Product].[Drink].Children}} ON ROWS\n" + + "{{[Product].[Product].[Drink], [Product].[Product].[Drink].Children}} ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", mdxString); // Sort the products in ascending order. @@ -464,23 +462,23 @@ public void testSortDimension() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{Order({{[Product].[Drink], [Product].[Drink].Children}}, [Product].CurrentMember.Name, DESC)} ON ROWS\n" + + "{Order({{[Product].[Product].[Drink], [Product].[Product].[Drink].Children}}, [Product].CurrentMember.Name, DESC)} ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", sortedMdxString); CellSet results = query.execute(); String s = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Product].[Drink]}\n" - + "{[Product].[Drink].[Dairy]}\n" - + "{[Product].[Drink].[Beverages]}\n" - + "{[Product].[Drink].[Alcoholic Beverages]}\n" + + "{[Product].[Product].[Drink]}\n" + + "{[Product].[Product].[Drink].[Dairy]}\n" + + "{[Product].[Product].[Drink].[Beverages]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages]}\n" + "Row #0: 4,409.58\n" + "Row #1: 629.69\n" + "Row #2: 2,477.02\n" @@ -528,7 +526,7 @@ public void testSortMultipleDimension() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "CrossJoin({[Time].[1997].[Q3].[7]}, [Product].[Drink].Children) ON ROWS\n" + + "CrossJoin({[Time].[Time].[1997].[Q3].[7]}, [Product].[Product].[Drink].Children) ON ROWS\n" + "FROM [Sales]", mdxString); @@ -540,7 +538,7 @@ public void testSortMultipleDimension() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "CrossJoin({[Time].[1997].[Q3].[7]}, Order({[Product].[Drink].Children}, [Product].CurrentMember.Name, DESC)) ON ROWS\n" + + "CrossJoin({[Time].[Time].[1997].[Q3].[7]}, Order({[Product].[Product].[Drink].Children}, [Product].CurrentMember.Name, DESC)) ON ROWS\n" + "FROM [Sales]", sortedMdxString); @@ -552,9 +550,9 @@ public void testSortMultipleDimension() throws Exception { + "Axis #1:\n" + "{[Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Time].[1997].[Q3].[7], [Product].[Drink].[Dairy]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Drink].[Beverages]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Drink].[Alcoholic Beverages]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Drink].[Dairy]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Drink].[Beverages]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Drink].[Alcoholic Beverages]}\n" + "Row #0: 629.69\n" + "Row #1: 2,477.02\n" + "Row #2: 1,302.87\n", @@ -571,7 +569,7 @@ public void testSortMultipleDimension() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "NON EMPTY CrossJoin({[Time].[1997].[Q3].[7]}, Order({[Product].[Food].Children}, [Product].CurrentMember.Name, DESC)) ON ROWS\n" + + "NON EMPTY CrossJoin({[Time].[Time].[1997].[Q3].[7]}, Order({[Product].[Product].[Food].Children}, [Product].CurrentMember.Name, DESC)) ON ROWS\n" + "FROM [Sales]", sortedMdxNonEmptyString); @@ -583,21 +581,21 @@ public void testSortMultipleDimension() throws Exception { + "Axis #1:\n" + "{[Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Starchy Foods]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Snacks]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Snack Foods]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Seafood]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Produce]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Meat]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Frozen Foods]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Eggs]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Deli]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Dairy]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Canned Products]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Canned Foods]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Breakfast Foods]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Baking Goods]}\n" - + "{[Time].[1997].[Q3].[7], [Product].[Food].[Baked Goods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Starchy Foods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Snacks]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Snack Foods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Seafood]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Produce]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Meat]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Frozen Foods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Eggs]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Deli]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Dairy]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Canned Products]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Canned Foods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Breakfast Foods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Baking Goods]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Product].[Product].[Food].[Baked Goods]}\n" + "Row #0: 1,059.06\n" + "Row #1: 1,248.92\n" + "Row #2: 6,342.01\n" @@ -677,7 +675,7 @@ public void testSelectionContext() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "Hierarchize(Union(CrossJoin({[Product].[All Products], [Product].[All Products].Children}, CrossJoin({[Time].[1997]}, {[Store].[All Stores]})), Union(CrossJoin({[Product].[Drink]}, CrossJoin({[Time].[1997].[Q3]}, [Store].[All Stores].Children)), CrossJoin({[Product].[Drink]}, CrossJoin([Time].[1997].Children, {[Store].[All Stores]}))))) ON ROWS\n" + + "Hierarchize(Union(CrossJoin({[Product].[Product].[All Products], [Product].[Product].[All Products].Children}, CrossJoin({[Time].[Time].[1997]}, {[Store].[Store].[All Stores]})), Union(CrossJoin({[Product].[Product].[Drink]}, CrossJoin({[Time].[Time].[1997].[Q3]}, [Store].[Store].[All Stores].Children)), CrossJoin({[Product].[Product].[Drink]}, CrossJoin([Time].[Time].[1997].Children, {[Store].[Store].[All Stores]}))))) ON ROWS\n" + "FROM [Sales]", mdxString); @@ -691,7 +689,7 @@ public void testSelectionContext() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "Order(Hierarchize(Union(CrossJoin({[Product].[All Products], [Product].[All Products].Children}, CrossJoin({[Time].[1997]}, {[Store].[All Stores]})), Union(CrossJoin({[Product].[Drink]}, CrossJoin({[Time].[1997].[Q3]}, [Store].[All Stores].Children)), CrossJoin({[Product].[Drink]}, CrossJoin([Time].[1997].Children, {[Store].[All Stores]}))))), [Measures].[Store Sales], ASC) ON ROWS\n" + + "Order(Hierarchize(Union(CrossJoin({[Product].[Product].[All Products], [Product].[Product].[All Products].Children}, CrossJoin({[Time].[Time].[1997]}, {[Store].[Store].[All Stores]})), Union(CrossJoin({[Product].[Product].[Drink]}, CrossJoin({[Time].[Time].[1997].[Q3]}, [Store].[Store].[All Stores].Children)), CrossJoin({[Product].[Product].[Drink]}, CrossJoin([Time].[Time].[1997].Children, {[Store].[Store].[All Stores]}))))), [Measures].[Store Sales], ASC) ON ROWS\n" + "FROM [Sales]", sortedMdxString); @@ -703,17 +701,17 @@ public void testSelectionContext() throws Exception { + "Axis #1:\n" + "{[Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Product].[All Products], [Time].[1997], [Store].[All Stores]}\n" - + "{[Product].[Drink], [Time].[1997], [Store].[All Stores]}\n" - + "{[Product].[Drink], [Time].[1997].[Q1], [Store].[All Stores]}\n" - + "{[Product].[Drink], [Time].[1997].[Q2], [Store].[All Stores]}\n" - + "{[Product].[Drink], [Time].[1997].[Q3], [Store].[All Stores]}\n" - + "{[Product].[Drink], [Time].[1997].[Q3], [Store].[Canada]}\n" - + "{[Product].[Drink], [Time].[1997].[Q3], [Store].[Mexico]}\n" - + "{[Product].[Drink], [Time].[1997].[Q3], [Store].[USA]}\n" - + "{[Product].[Drink], [Time].[1997].[Q4], [Store].[All Stores]}\n" - + "{[Product].[Non-Consumable], [Time].[1997], [Store].[All Stores]}\n" - + "{[Product].[Food], [Time].[1997], [Store].[All Stores]}\n" + + "{[Product].[Product].[All Products], [Time].[Time].[1997], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q1], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q2], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q3], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q3], [Store].[Store].[Canada]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q3], [Store].[Store].[Mexico]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q3], [Store].[Store].[USA]}\n" + + "{[Product].[Product].[Drink], [Time].[Time].[1997].[Q4], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Non-Consumable], [Time].[Time].[1997], [Store].[Store].[All Stores]}\n" + + "{[Product].[Product].[Food], [Time].[Time].[1997], [Store].[Store].[All Stores]}\n" + "Row #0: 565,238.13\n" + "Row #1: 48,836.21\n" + "Row #2: 11,585.80\n" @@ -865,9 +863,9 @@ public void testSortAxis() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{{[Product].[Drink], [Product].[Drink].Children}} ON ROWS\n" + + "{{[Product].[Product].[Drink], [Product].[Product].[Drink].Children}} ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", mdxString); // Sort the rows in ascending order. @@ -880,23 +878,23 @@ public void testSortAxis() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "Order({{[Product].[Drink], [Product].[Drink].Children}}, [Measures].[Store Sales], BASC) ON ROWS\n" + + "Order({{[Product].[Product].[Drink], [Product].[Product].[Drink].Children}}, [Measures].[Store Sales], BASC) ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", sortedMdxString); CellSet results = query.execute(); String s = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Store Sales]}\n" + "Axis #2:\n" - + "{[Product].[Drink].[Dairy]}\n" - + "{[Product].[Drink].[Alcoholic Beverages]}\n" - + "{[Product].[Drink].[Beverages]}\n" - + "{[Product].[Drink]}\n" + + "{[Product].[Product].[Drink].[Dairy]}\n" + + "{[Product].[Product].[Drink].[Alcoholic Beverages]}\n" + + "{[Product].[Product].[Drink].[Beverages]}\n" + + "{[Product].[Product].[Drink]}\n" + "Row #0: 629.69\n" + "Row #1: 1,302.87\n" + "Row #2: 2,477.02\n" @@ -941,10 +939,10 @@ public void testDimensionsOrder() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "CrossJoin([Product].[Drink].Children, " - + "CrossJoin({[Store].[USA], " - + "[Store].[USA].Children}, " - + "[Time].[1997].Children)) ON ROWS\n" + + "CrossJoin([Product].[Product].[Drink].Children, " + + "CrossJoin({[Store].[Store].[USA], " + + "[Store].[Store].[USA].Children}, " + + "[Time].[Time].[1997].Children)) ON ROWS\n" + "FROM [Sales]", mdxString); @@ -958,10 +956,10 @@ public void testDimensionsOrder() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "CrossJoin({[Store].[USA], " - + "[Store].[USA].Children}, " - + "CrossJoin([Product].[Drink].Children, " - + "[Time].[1997].Children)) ON ROWS\n" + + "CrossJoin({[Store].[Store].[USA], " + + "[Store].[Store].[USA].Children}, " + + "CrossJoin([Product].[Product].[Drink].Children, " + + "[Time].[Time].[1997].Children)) ON ROWS\n" + "FROM [Sales]", mdxString); @@ -975,10 +973,10 @@ public void testDimensionsOrder() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "CrossJoin({[Store].[USA], " - + "[Store].[USA].Children}, " - + "CrossJoin([Time].[1997].Children, " - + "[Product].[Drink].Children)) ON ROWS\n" + + "CrossJoin({[Store].[Store].[USA], " + + "[Store].[Store].[USA].Children}, " + + "CrossJoin([Time].[Time].[1997].Children, " + + "[Product].[Product].[Drink].Children)) ON ROWS\n" + "FROM [Sales]", mdxString); } @@ -1013,8 +1011,8 @@ public void testDimensionsHierarchize() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{Hierarchize({{[Store].[USA], " - + "[Store].[USA].Children}}, POST)} ON ROWS\n" + + "{Hierarchize({{[Store].[Store].[USA], " + + "[Store].[Store].[USA].Children}}, POST)} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -1027,8 +1025,8 @@ public void testDimensionsHierarchize() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{Hierarchize({{[Store].[USA], " - + "[Store].[USA].Children}})} ON ROWS\n" + + "{Hierarchize({{[Store].[Store].[USA], " + + "[Store].[Store].[USA].Children}})} ON ROWS\n" + "FROM [Sales]", mdxString); } @@ -1074,7 +1072,7 @@ public void testQueryVersusParseTreeIndependence() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{{[Product].[Drink], [Product].[Drink].Children}} ON ROWS\n" + + "{{[Product].[Product].[Drink], [Product].[Product].[Drink].Children}} ON ROWS\n" + "FROM [Sales]", originalMdxString); @@ -1131,9 +1129,9 @@ public void testExclusionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "{[Product].[Drink].[Beverages].Children, [Product].[Food].[Frozen Foods].Children} ON ROWS\n" + + "{[Product].[Product].[Drink].[Beverages].Children, [Product].[Product].[Food].[Frozen Foods].Children} ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", mdxString); // Validate the returned results @@ -1141,20 +1139,20 @@ public void testExclusionModes() throws Exception { String resultsString = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Sales Count]}\n" + "Axis #2:\n" - + "{[Product].[Drink].[Beverages].[Carbonated Beverages]}\n" - + "{[Product].[Drink].[Beverages].[Drinks]}\n" - + "{[Product].[Drink].[Beverages].[Hot Beverages]}\n" - + "{[Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" - + "{[Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" - + "{[Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" - + "{[Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" - + "{[Product].[Food].[Frozen Foods].[Meat]}\n" - + "{[Product].[Food].[Frozen Foods].[Pizza]}\n" - + "{[Product].[Food].[Frozen Foods].[Vegetables]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Carbonated Beverages]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Drinks]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Hot Beverages]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Meat]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Pizza]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Vegetables]}\n" + "Row #0: 103\n" + "Row #1: 65\n" + "Row #2: 125\n" @@ -1179,9 +1177,9 @@ public void testExclusionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "{Except({[Product].[Drink].[Beverages].Children, [Product].[Food].[Frozen Foods].Children}, {[Product].[Drink].[Beverages].[Carbonated Beverages]})} ON ROWS\n" + + "{Except({[Product].[Product].[Drink].[Beverages].Children, [Product].[Product].[Food].[Frozen Foods].Children}, {[Product].[Product].[Drink].[Beverages].[Carbonated Beverages]})} ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", mdxString); // Validate the returned results @@ -1189,19 +1187,19 @@ public void testExclusionModes() throws Exception { resultsString = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Sales Count]}\n" + "Axis #2:\n" - + "{[Product].[Drink].[Beverages].[Drinks]}\n" - + "{[Product].[Drink].[Beverages].[Hot Beverages]}\n" - + "{[Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" - + "{[Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" - + "{[Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" - + "{[Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" - + "{[Product].[Food].[Frozen Foods].[Meat]}\n" - + "{[Product].[Food].[Frozen Foods].[Pizza]}\n" - + "{[Product].[Food].[Frozen Foods].[Vegetables]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Drinks]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Hot Beverages]}\n" + + "{[Product].[Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Meat]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Pizza]}\n" + + "{[Product].[Product].[Food].[Frozen Foods].[Vegetables]}\n" + "Row #0: 65\n" + "Row #1: 125\n" + "Row #2: 100\n" @@ -1248,9 +1246,9 @@ public void testExclusionMultipleDimensionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "Hierarchize(Union(CrossJoin({[Store].[USA]}, [Product].[Drink].[Beverages].Children), CrossJoin({[Store].[USA]}, [Product].[Food].[Frozen Foods].Children))) ON ROWS\n" + + "Hierarchize(Union(CrossJoin({[Store].[Store].[USA]}, [Product].[Product].[Drink].[Beverages].Children), CrossJoin({[Store].[Store].[USA]}, [Product].[Product].[Food].[Frozen Foods].Children))) ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", mdxString); // Validate the returned results @@ -1258,20 +1256,20 @@ public void testExclusionMultipleDimensionModes() throws Exception { String resultsString = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Sales Count]}\n" + "Axis #2:\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Carbonated Beverages]}\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Drinks]}\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Hot Beverages]}\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Meat]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Pizza]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Vegetables]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Carbonated Beverages]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Drinks]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Hot Beverages]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Meat]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Pizza]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Vegetables]}\n" + "Row #0: 103\n" + "Row #1: 65\n" + "Row #2: 125\n" @@ -1296,9 +1294,9 @@ public void testExclusionMultipleDimensionModes() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "Hierarchize(Union(CrossJoin({[Store].[USA]}, Except({[Product].[Drink].[Beverages].Children}, {[Product].[Drink].[Beverages].[Carbonated Beverages]})), CrossJoin({[Store].[USA]}, Except({[Product].[Food].[Frozen Foods].Children}, {[Product].[Drink].[Beverages].[Carbonated Beverages]})))) ON ROWS\n" + + "Hierarchize(Union(CrossJoin({[Store].[Store].[USA]}, Except({[Product].[Product].[Drink].[Beverages].Children}, {[Product].[Product].[Drink].[Beverages].[Carbonated Beverages]})), CrossJoin({[Store].[Store].[USA]}, Except({[Product].[Product].[Food].[Frozen Foods].Children}, {[Product].[Product].[Drink].[Beverages].[Carbonated Beverages]})))) ON ROWS\n" + "FROM [Sales]\n" - + "WHERE {[Time].[1997].[Q3].[7]}", + + "WHERE {[Time].[Time].[1997].[Q3].[7]}", mdxString); // Validate the returned results @@ -1306,19 +1304,19 @@ public void testExclusionMultipleDimensionModes() throws Exception { resultsString = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Sales Count]}\n" + "Axis #2:\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Drinks]}\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Hot Beverages]}\n" - + "{[Store].[USA], [Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Meat]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Pizza]}\n" - + "{[Store].[USA], [Product].[Food].[Frozen Foods].[Vegetables]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Drinks]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Hot Beverages]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Drink].[Beverages].[Pure Juice Beverages]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Breakfast Foods]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Frozen Desserts]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Frozen Entrees]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Meat]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Pizza]}\n" + + "{[Store].[Store].[USA], [Product].[Product].[Food].[Frozen Foods].[Vegetables]}\n" + "Row #0: 65\n" + "Row #1: 125\n" + "Row #2: 100\n" @@ -1365,9 +1363,9 @@ public void testCompoundFilter() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "{[Store].[USA]} ON ROWS\n" + + "{[Store].[Store].[USA]} ON ROWS\n" + "FROM [Sales]\n" - + "WHERE Hierarchize(Union(CrossJoin({[Product].[Drink].[Beverages]}, {[Time].[1997].[Q3].[7]}), CrossJoin({[Product].[Food].[Frozen Foods]}, {[Time].[1997].[Q3].[7]})))", + + "WHERE Hierarchize(Union(CrossJoin({[Product].[Product].[Drink].[Beverages]}, {[Time].[Time].[1997].[Q3].[7]}), CrossJoin({[Product].[Product].[Food].[Frozen Foods]}, {[Time].[Time].[1997].[Q3].[7]})))", mdxString); // Validate the returned results @@ -1375,12 +1373,12 @@ public void testCompoundFilter() throws Exception { String resultsString = TestContext.toString(results); TestContext.assertEqualsVerbose( "Axis #0:\n" - + "{[Product].[Drink].[Beverages], [Time].[1997].[Q3].[7]}\n" - + "{[Product].[Food].[Frozen Foods], [Time].[1997].[Q3].[7]}\n" + + "{[Product].[Product].[Drink].[Beverages], [Time].[Time].[1997].[Q3].[7]}\n" + + "{[Product].[Product].[Food].[Frozen Foods], [Time].[Time].[1997].[Q3].[7]}\n" + "Axis #1:\n" + "{[Measures].[Sales Count]}\n" + "Axis #2:\n" - + "{[Store].[USA]}\n" + + "{[Store].[Store].[USA]}\n" + "Row #0: 1,187\n", resultsString); } @@ -1411,7 +1409,7 @@ public void testMultipleHierarchyConsistency() throws Exception { TestContext.assertEqualsVerbose( "SELECT\n" + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "{{[Time.Weekly].[1997]}, Filter({{[Time.Weekly].[1997].[10].[23], [Time.Weekly].[1997].[10].[28]}}, (Exists(Ancestor([Time.Weekly].CurrentMember, [Time.Weekly].[Year]), {[Time.Weekly].[1997]}).Count > 0))} ON ROWS\n" + + "{{[Time].[Weekly].[1997]}, Filter({{[Time].[Weekly].[1997].[10].[23], [Time].[Weekly].[1997].[10].[28]}}, (Exists(Ancestor([Time].[Weekly].CurrentMember, [Time].[Weekly].[Year]), {[Time].[Weekly].[1997]}).Count > 0))} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -1424,9 +1422,9 @@ public void testMultipleHierarchyConsistency() throws Exception { + "Axis #1:\n" + "{[Measures].[Sales Count]}\n" + "Axis #2:\n" - + "{[Time.Weekly].[1997]}\n" - + "{[Time.Weekly].[1997].[10].[23]}\n" - + "{[Time.Weekly].[1997].[10].[28]}\n" + + "{[Time].[Weekly].[1997]}\n" + + "{[Time].[Weekly].[1997].[10].[23]}\n" + + "{[Time].[Weekly].[1997].[10].[28]}\n" + "Row #0: 86,837\n" + "Row #1: 123\n" + "Row #2: \n", @@ -1480,8 +1478,8 @@ public void testHierarchyConsistency() throws Exception { String mdxString = query.getSelect().toString(); TestContext.assertEqualsVerbose( "SELECT\n" - + "{{[Product].[All Products]}, {[Product].[Food]}, Filter({{[Product].[Food].[Deli], [Product].[Food].[Dairy]}}, (Exists(Ancestor([Product].CurrentMember, [Product].[Product Family]), {[Product].[Food]}).Count > 0)), Filter({{[Product].[Product Category].Members}}, ((Exists(Ancestor([Product].CurrentMember, [Product].[Product Family]), {[Product].[Food]}).Count > 0) AND (Exists(Ancestor([Product].CurrentMember, [Product].[Product Department]), {[Product].[Food].[Deli], [Product].[Food].[Dairy]}).Count > 0)))} ON COLUMNS,\n" - + "{{[Time].[1997]}, Filter({{[Time].[1997].[Q3].[7], [Time].[1997].[Q4].[11]}}, (Exists(Ancestor([Time].CurrentMember, [Time].[Year]), {[Time].[1997]}).Count > 0))} ON ROWS\n" + + "{{[Product].[Product].[All Products]}, {[Product].[Product].[Food]}, Filter({{[Product].[Product].[Food].[Deli], [Product].[Product].[Food].[Dairy]}}, (Exists(Ancestor([Product].[Product].CurrentMember, [Product].[Product].[Product Family]), {[Product].[Product].[Food]}).Count > 0)), Filter({{[Product].[Product].[Product Category].Members}}, ((Exists(Ancestor([Product].[Product].CurrentMember, [Product].[Product].[Product Family]), {[Product].[Product].[Food]}).Count > 0) AND (Exists(Ancestor([Product].[Product].CurrentMember, [Product].[Product].[Product Department]), {[Product].[Product].[Food].[Deli], [Product].[Product].[Food].[Dairy]}).Count > 0)))} ON COLUMNS,\n" + + "{{[Time].[Time].[1997]}, Filter({{[Time].[Time].[1997].[Q3].[7], [Time].[Time].[1997].[Q4].[11]}}, (Exists(Ancestor([Time].[Time].CurrentMember, [Time].[Time].[Year]), {[Time].[Time].[1997]}).Count > 0))} ON ROWS\n" + "FROM [Sales]", mdxString); @@ -1492,17 +1490,17 @@ public void testHierarchyConsistency() throws Exception { "Axis #0:\n" + "{}\n" + "Axis #1:\n" - + "{[Product].[All Products]}\n" - + "{[Product].[Food]}\n" - + "{[Product].[Food].[Deli]}\n" - + "{[Product].[Food].[Dairy]}\n" - + "{[Product].[Food].[Dairy].[Dairy]}\n" - + "{[Product].[Food].[Deli].[Meat]}\n" - + "{[Product].[Food].[Deli].[Side Dishes]}\n" + + "{[Product].[Product].[All Products]}\n" + + "{[Product].[Product].[Food]}\n" + + "{[Product].[Product].[Food].[Deli]}\n" + + "{[Product].[Product].[Food].[Dairy]}\n" + + "{[Product].[Product].[Food].[Dairy].[Dairy]}\n" + + "{[Product].[Product].[Food].[Deli].[Meat]}\n" + + "{[Product].[Product].[Food].[Deli].[Side Dishes]}\n" + "Axis #2:\n" - + "{[Time].[1997]}\n" - + "{[Time].[1997].[Q3].[7]}\n" - + "{[Time].[1997].[Q4].[11]}\n" + + "{[Time].[Time].[1997]}\n" + + "{[Time].[Time].[1997].[Q3].[7]}\n" + + "{[Time].[Time].[1997].[Q4].[11]}\n" + "Row #0: 266,773\n" + "Row #0: 191,940\n" + "Row #0: 12,037\n" @@ -1537,8 +1535,8 @@ public void testHierarchyConsistency() throws Exception { String mdxString2 = query.getSelect().toString(); TestContext.assertEqualsVerbose( "SELECT\n" - + "{[Product].[Food]} ON COLUMNS,\n" - + "Hierarchize(Union(CrossJoin(Filter({[Time].[1997].[Q3].[7]}, (Exists(Ancestor([Time].CurrentMember, [Time].[Year]), {[Time].[1997]}).Count > 0)), {[Measures].[Sales Count]}), Union(CrossJoin(Filter({[Time].[1997].[Q4].[11]}, (Exists(Ancestor([Time].CurrentMember, [Time].[Year]), {[Time].[1997]}).Count > 0)), {[Measures].[Sales Count]}), CrossJoin({[Time].[1997]}, {[Measures].[Sales Count]})))) ON ROWS\n" + + "{[Product].[Product].[Food]} ON COLUMNS,\n" + + "Hierarchize(Union(CrossJoin(Filter({[Time].[Time].[1997].[Q3].[7]}, (Exists(Ancestor([Time].[Time].CurrentMember, [Time].[Time].[Year]), {[Time].[Time].[1997]}).Count > 0)), {[Measures].[Sales Count]}), Union(CrossJoin(Filter({[Time].[Time].[1997].[Q4].[11]}, (Exists(Ancestor([Time].[Time].CurrentMember, [Time].[Time].[Year]), {[Time].[Time].[1997]}).Count > 0)), {[Measures].[Sales Count]}), CrossJoin({[Time].[Time].[1997]}, {[Measures].[Sales Count]})))) ON ROWS\n" + "FROM [Sales]", mdxString2); @@ -1549,11 +1547,11 @@ public void testHierarchyConsistency() throws Exception { "Axis #0:\n" + "{}\n" + "Axis #1:\n" - + "{[Product].[Food]}\n" + + "{[Product].[Product].[Food]}\n" + "Axis #2:\n" - + "{[Time].[1997], [Measures].[Sales Count]}\n" - + "{[Time].[1997].[Q3].[7], [Measures].[Sales Count]}\n" - + "{[Time].[1997].[Q4].[11], [Measures].[Sales Count]}\n" + + "{[Time].[Time].[1997], [Measures].[Sales Count]}\n" + + "{[Time].[Time].[1997].[Q3].[7], [Measures].[Sales Count]}\n" + + "{[Time].[Time].[1997].[Q4].[11], [Measures].[Sales Count]}\n" + "Row #0: 62,445\n" + "Row #1: 5,552\n" + "Row #2: 5,944\n", @@ -1576,8 +1574,8 @@ public void testHierarchyConsistency() throws Exception { String mdxString3 = query.getSelect().toString(); TestContext.assertEqualsVerbose( "SELECT\n" - + "{[Product].[Food]} ON COLUMNS,\n" - + "Hierarchize(Union(CrossJoin({[Measures].[Sales Count]}, [Customers].[Country].Members), CrossJoin({[Measures].[Sales Count]}, [Customers].[State Province].Members))) ON ROWS\n" + + "{[Product].[Product].[Food]} ON COLUMNS,\n" + + "Hierarchize(Union(CrossJoin({[Measures].[Sales Count]}, [Customers].[Customers].[Country].Members), CrossJoin({[Measures].[Sales Count]}, [Customers].[Customers].[State Province].Members))) ON ROWS\n" + "FROM [Sales]", mdxString3); } diff --git a/testsrc/org/olap4j/transform/TransformTest.java b/testsrc/org/olap4j/transform/TransformTest.java index 4728594..43045dd 100644 --- a/testsrc/org/olap4j/transform/TransformTest.java +++ b/testsrc/org/olap4j/transform/TransformTest.java @@ -129,7 +129,7 @@ public void testDrillReplaceTransform() throws SQLException { "SELECT {[Measures].[Unit Sales], " + " [Measures].[Store Cost], " + " [Measures].[Store Sales]} ON COLUMNS, " - + " {[Product].[All Products].Children} ON ROWS " + + " {[Product].[Product].[All Products].Children} ON ROWS " + "FROM Sales " + "WHERE ([Time].[1997])"; @@ -163,7 +163,7 @@ public void testRollUpLevelTransform() throws SQLException { "SELECT {[Measures].[Unit Sales], " + " [Measures].[Store Cost], " + " [Measures].[Store Sales]} ON COLUMNS, " - + " {[Product].[Food].[Deli].Parent.Level.Members} ON ROWS " + + " {[Product].[Product].[Food].[Deli].Parent.Level.Members} ON ROWS " + "FROM Sales " + "WHERE ([Time].[1997])";