diff --git a/src/org/olap4j/impl/Bug.java b/src/org/olap4j/impl/Bug.java new file mode 100644 index 0000000..d1f1321 --- /dev/null +++ b/src/org/olap4j/impl/Bug.java @@ -0,0 +1,57 @@ +/* +// This software is subject to the terms of the Eclipse Public License v1.0 +// Agreement, available at the following URL: +// http://www.eclipse.org/legal/epl-v10.html. +// Copyright (C) 2010-2010 Julian Hyde +// All Rights Reserved. +// You must accept the terms of that agreement to use this software. +*/ +package org.olap4j.impl; + +/** + * Holder for constants which indicate whether particular issues have been + * fixed. Reference one of those constants in your code, and it is clear which + * code can be enabled when the bug is fixed. Generally a constant is removed + * when its bug is fixed. + * + *

Developers, please use the naming format + * Bug<Product><Number>Fixed for constants, and include + * a hyperlink to the bug database record in the comments. Product will usually + * be "Olap4j", but sometimes we are blocked by bugs in other components, such + * as the JDK or Mondrian. + * + *

Cleanup items

+ * + * The following is a list of cleanup items. They are not bugs per se: + * functionality is not wrong, just the organization of the code. If they were + * bugs, they would be in jira. It makes sense to have the list here, so that + * referenced class, method and variable names show up as uses in code searches. + * + *
+ * + *
Split out Test Compatability Kit (TCK)
+ *
Factor parts of olap4j test suite that depend on an olap4j implementation + * (such as mondrian) into a jar that can be invoked by that implementation. + * Then each implementation is responsible for running the TCK. It can also + * manage which version of the TCK it implements, so that it does not have to + * be absolutely up to date. Some parts of the olap4j suite do not stretch the + * capabilities of the OLAP engine or driver, and will remain part of + * the olap4j suite, using mondrian as reference implementation.
+ * + *
+ * + * @author jhyde + * @version $Id$ + * @since Nov 9, 2010 + */ +public abstract class Bug { + /** + * Whether + * bug 3106220, + * "Complex selection context broken" + * is fixed. + */ + public static final boolean BugOlap4j3106220Fixed = false; +} + +// End Bug.java diff --git a/testsrc/org/olap4j/OlapTest.java b/testsrc/org/olap4j/OlapTest.java index 86af0fe..6c84238 100644 --- a/testsrc/org/olap4j/OlapTest.java +++ b/testsrc/org/olap4j/OlapTest.java @@ -8,6 +8,7 @@ */ package org.olap4j; +import org.olap4j.impl.Bug; import org.olap4j.mdx.SelectNode; import org.olap4j.metadata.*; import org.olap4j.query.*; @@ -790,63 +791,69 @@ public void testComplexSelectionContext() throws Exception { Axis.ROWS, productDimension.getAxis().getLocation()); assertEquals( - Axis.ROWS, - timeDimension.getAxis().getLocation()); + Axis.ROWS, + timeDimension.getAxis().getLocation()); assertEquals( Axis.COLUMNS, measuresDimension.getAxis().getLocation()); + if (!Bug.BugOlap4j3106220Fixed) { + return; + } + SelectNode mdx = query.getSelect(); String mdxString = mdx.toString(); + TestContext.assertEqualsVerbose( - "SELECT\n" - + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "Hierarchize(Union(CrossJoin({[Product].[All Products]}, [Time].[1997].Children), CrossJoin([Product].[All Products].Children, [Time].[1997].Children))) ON ROWS\n" - + "FROM [Sales]", - mdxString); + "SELECT\n" + + "{[Measures].[Store Sales]} ON COLUMNS,\n" + + "Hierarchize(Union(CrossJoin({[Product].[All Products]}, [Time].[1997].Children), CrossJoin([Product].[All Products].Children, [Time].[1997].Children))) ON ROWS\n" + + "FROM [Sales]", + mdxString); CellSet results = query.execute(); String s = TestContext.toString(results); TestContext.assertEqualsVerbose( - "Axis #0:\n" - + "{}\n" - + "Axis #1:\n" - + "{[Measures].[Store Sales]}\n" - + "Axis #2:\n" - + "{[Product].[All Products], [Time].[1997].[Q1]}\n" - + "{[Product].[All Products], [Time].[1997].[Q2]}\n" - + "{[Product].[All Products], [Time].[1997].[Q3]}\n" - + "{[Product].[All Products], [Time].[1997].[Q4]}\n" - + "{[Product].[Drink], [Time].[1997].[Q1]}\n" - + "{[Product].[Drink], [Time].[1997].[Q2]}\n" - + "{[Product].[Drink], [Time].[1997].[Q3]}\n" - + "{[Product].[Drink], [Time].[1997].[Q4]}\n" - + "{[Product].[Food], [Time].[1997].[Q1]}\n" - + "{[Product].[Food], [Time].[1997].[Q2]}\n" - + "{[Product].[Food], [Time].[1997].[Q3]}\n" - + "{[Product].[Food], [Time].[1997].[Q4]}\n" - + "{[Product].[Non-Consumable], [Time].[1997].[Q1]}\n" - + "{[Product].[Non-Consumable], [Time].[1997].[Q2]}\n" - + "{[Product].[Non-Consumable], [Time].[1997].[Q3]}\n" - + "{[Product].[Non-Consumable], [Time].[1997].[Q4]}\n" - + "Row #0: 139,628.35\n" - + "Row #1: 132,666.27\n" - + "Row #2: 140,271.89\n" - + "Row #3: 152,671.62\n" - + "Row #4: 11,585.80\n" - + "Row #5: 11,914.58\n" - + "Row #6: 11,994.00\n" - + "Row #7: 13,341.83\n" - + "Row #8: 101,261.32\n" - + "Row #9: 95,436.00\n" - + "Row #10: 101,807.60\n" - + "Row #11: 110,530.67\n" - + "Row #12: 26,781.23\n" - + "Row #13: 25,315.69\n" - + "Row #14: 26,470.29\n" - + "Row #15: 28,799.12\n", - s); + "Axis #0:\n" + + "{}\n" + + "Axis #1:\n" + + "{[Measures].[Store Sales]}\n" + + "Axis #2:\n" + + "{[Product].[All Products], [Time].[1997].[Q1]}\n" + + "{[Product].[All Products], [Time].[1997].[Q2]}\n" + + "{[Product].[All Products], [Time].[1997].[Q3]}\n" + + "{[Product].[All Products], [Time].[1997].[Q4]}\n" + + "{[Product].[Drink], [Time].[1997].[Q1]}\n" + + "{[Product].[Drink], [Time].[1997].[Q2]}\n" + + "{[Product].[Drink], [Time].[1997].[Q3]}\n" + + "{[Product].[Drink], [Time].[1997].[Q4]}\n" + + "{[Product].[Food], [Time].[1997].[Q1]}\n" + + "{[Product].[Food], [Time].[1997].[Q2]}\n" + + "{[Product].[Food], [Time].[1997].[Q3]}\n" + + "{[Product].[Food], [Time].[1997].[Q4]}\n" + + "{[Product].[Non-Consumable], [Time].[1997].[Q1]}\n" + + "{[Product].[Non-Consumable], [Time].[1997].[Q2]}\n" + + "{[Product].[Non-Consumable], [Time].[1997].[Q3]}\n" + + "{[Product].[Non-Consumable], [Time].[1997].[Q4]}\n" + + "Row #0: 139,628.35\n" + + "Row #1: 132,666.27\n" + + "Row #2: 140,271.89\n" + + "Row #3: 152,671.62\n" + + "Row #4: 11,585.80\n" + + "Row #5: 11,914.58\n" + + "Row #6: 11,994.00\n" + + "Row #7: 13,341.83\n" + + "Row #8: 101,261.32\n" + + "Row #9: 95,436.00\n" + + "Row #10: 101,807.60\n" + + "Row #11: 110,530.67\n" + + "Row #12: 26,781.23\n" + + "Row #13: 25,315.69\n" + + "Row #14: 26,470.29\n" + + "Row #15: 28,799.12\n", + s); } + public void testSortAxis() { try { Cube cube = getFoodmartCube("Sales");