Skip to content

Commit

Permalink
MONDRIAN: Link test cases relating to keys in member names (one of wh…
Browse files Browse the repository at this point in the history
…ich was

    failing) to bug MONDRIAN-485.

[git-p4: depot-paths = "//open/mondrian/": change = 14597]
  • Loading branch information
julianhyde committed Sep 8, 2011
1 parent c3df9bb commit 4f7ef16
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
9 changes: 9 additions & 0 deletions src/main/mondrian/util/Bug.java
Expand Up @@ -134,6 +134,15 @@ public static boolean olap4jUpgrade(String reason) {
*/
public static final boolean BugMondrian361Fixed = false;

/**
* Whether
* <a href="http://jira.pentaho.com/browse/MONDRIAN-485">bug MONDRIAN-485,
* "Member key treated as member name in WHERE"</a>
* is fixed. This bug is a placeholder for all support for keys in
* member names (e.g. "[Product].[Product Name].&12345").
*/
public static final boolean BugMondrian485Fixed = false;

/**
* Whether
* <a href="http://jira.pentaho.com/browse/MONDRIAN-486">bug MONDRIAN-486,
Expand Down
18 changes: 12 additions & 6 deletions testsrc/main/mondrian/rolap/IndexedValuesTest.java
Expand Up @@ -10,10 +10,13 @@
package mondrian.rolap;

import mondrian.test.FoodMartTestCase;
import mondrian.util.Bug;

/**
* Test case for '&amp;[..]' capability in MDX identifiers.
*
* @see Bug#BugMondrian485Fixed
*
* @author pierluiggi@users.sourceforge.net
* @version $Id$
*/
Expand Down Expand Up @@ -54,22 +57,25 @@ public void testQueryWithIndex() {
+ "ON ROWS FROM [HR]",
desiredResult);

if (!Bug.BugMondrian485Fixed) {
return;
}

// Cannot find members that are not at root of hierarchy.
// (We should fix this.)
assertQueryThrows(
assertQueryReturns(
"SELECT {[Measures].[Org Salary], [Measures].[Count]} "
+ "ON COLUMNS, "
+ "{[Employees].&[4]} "
+ "ON ROWS FROM [HR]",
"MDX object '[Employees].&[4]' not found in cube 'HR'");
"something");

// "level.&key" syntax not supported
// (We should fix this.)
assertQueryThrows(
// "level.&key" syntax
assertQueryReturns(
"SELECT [Measures] ON COLUMNS, "
+ "{[Product].[Product Name].&[9]} "
+ "ON ROWS FROM [Sales]",
"MDX object '[Employees].&[4]' not found in cube 'HR'");
"something");
}
}

Expand Down
3 changes: 2 additions & 1 deletion testsrc/main/mondrian/test/Ssas2005CompatibilityTest.java
Expand Up @@ -12,6 +12,7 @@
import java.sql.SQLException;

import mondrian.olap.*;
import mondrian.util.Bug;

/**
* Unit tests that check compatibility with Microsoft SQL Server Analysis
Expand Down Expand Up @@ -50,7 +51,7 @@ public class Ssas2005CompatibilityTest extends FoodMartTestCase {
/**
* Keys as part of member names.
*/
public static final boolean KEY_IMPL = false;
public static final boolean KEY_IMPL = Bug.BugMondrian485Fixed;

/**
* Catch-all for tests that depend on something that hasn't been
Expand Down

0 comments on commit 4f7ef16

Please sign in to comment.