Skip to content

Commit

Permalink
MONDRIAN: test case for MONDRIAN-705
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 13420]
  • Loading branch information
Matt Campbell authored and Matt Campbell committed Feb 24, 2010
1 parent b93db1c commit df4480c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/mondrian/util/Bug.java
Expand Up @@ -173,6 +173,14 @@ public class Bug {
*/
public static final boolean BugMondrian675Fixed = false;

/**
* Whether
* <a href="http://jira.pentaho.com/browse/MONDRIAN-705">bug MONDRIAN-705,
* "Aggregate with grouping sets turned on causes exception"</a>
* is fixed.
*/
public static final boolean BugMondrian705Fixed = false;

/**
* Returns whether to avoid a test because the memory monitor may cause it
* to fail.
Expand Down
27 changes: 27 additions & 0 deletions testsrc/main/mondrian/rolap/GroupingSetQueryTest.java
Expand Up @@ -17,6 +17,7 @@
import mondrian.olap.MondrianProperties;
import mondrian.test.SqlPattern;
import mondrian.spi.Dialect;
import mondrian.util.Bug;
import org.olap4j.impl.Olap4jUtil;

/**
Expand Down Expand Up @@ -79,6 +80,32 @@ protected void tearDown() throws Exception {
prop.WarnIfNoPatternForDialect.set(origWarnIfNoPatternForDialect);
}

public void testGroupingSetsWithAggregateOverDefaultMember() {
if (Bug.BugMondrian705Fixed
&& getTestContext().getDialect().supportsGroupingSets())
{
prop.EnableGroupingSets.set(true);
assertQueryReturns(
"with member [Gender].[agg] as ' "
+ " Aggregate({[Gender].DefaultMember}, [Measures].[Store Cost])' "
+ "select "
+ " {[Measures].[Store Cost]} ON COLUMNS, "
+ " {[Gender].[Gender].Members, [Gender].[agg]} ON ROWS "
+ "from [Sales]",
"Axis #0:\n"
+ "{}\n"
+ "Axis #1:\n"
+ "{[Measures].[Store Cost]}\n"
+ "Axis #2:\n"
+ "{[Gender].[All Gender].[F]}\n"
+ "{[Gender].[All Gender].[M]}\n"
+ "{[Gender].[agg]}\n"
+ "Row #0: 111,777.48\n"
+ "Row #1: 113,849.75\n"
+ "Row #2: 225,627.23\n");
}
}

public void testGroupingSetForSingleColumnConstraint() {
prop.DisableCaching.setString("false");

Expand Down

0 comments on commit df4480c

Please sign in to comment.