Skip to content

Commit

Permalink
Log bug 3106220 and disable test.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@366 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Nov 9, 2010
1 parent b2c7edf commit 1741dbc
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 45 deletions.
57 changes: 57 additions & 0 deletions src/org/olap4j/impl/Bug.java
Original file line number Diff line number Diff line change
@@ -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.
*
* <p>Developers, please use the naming format
* <code>Bug&lt;Product&gt;&lt;Number&gt;Fixed</code> 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.
*
* <h3>Cleanup items</h3>
*
* 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.
*
* <dl>
*
* <dt>Split out Test Compatability Kit (TCK)</dt>
* <dd>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.</dd>
*
* </dl>
*
* @author jhyde
* @version $Id$
* @since Nov 9, 2010
*/
public abstract class Bug {
/**
* Whether
* <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=3106220&group_id=168953&atid=848534">bug 3106220,
* "Complex selection context broken"</a>
* is fixed.
*/
public static final boolean BugOlap4j3106220Fixed = false;
}

// End Bug.java
97 changes: 52 additions & 45 deletions testsrc/org/olap4j/OlapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 1741dbc

Please sign in to comment.