Skip to content

Commit

Permalink
Merge pull request pentaho#642 from YuryBY/clearview_repairing
Browse files Browse the repository at this point in the history
[TEST] - Creating BugMondrian2452Fixed flag until the bug will not be…
  • Loading branch information
mkambol committed Jan 28, 2016
2 parents 613e6a3 + f0fc465 commit 908955f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 28 deletions.
20 changes: 13 additions & 7 deletions src/main/mondrian/util/Bug.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
* 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.
* You must accept the terms of that agreement to use this software.
*
* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved.
// 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.
// You must accept the terms of that agreement to use this software.
//
// Copyright (c) 2002-2016 Pentaho Corporation.. All rights reserved.
*/

package mondrian.util;

import mondrian.olap.MondrianProperties;
Expand Down Expand Up @@ -238,6 +237,13 @@ public static boolean olap4jUpgrade(String reason) {
*/
public static final boolean BugMondrian1001Fixed = false;

/**
* Whether
* <a href="http://jira.pentaho.com/browse/MONDRIAN-2452">bug MONDRIAN-1001,
* "Tests disabled due to property trigger issues"</a> is fixed.
*/
public static final boolean BugMondrian2452Fixed = false;

/**
* Whether RolapCubeMember and RolapMember have been fully segregated; any
* piece of code should be working with one or the other, not both.
Expand Down
25 changes: 18 additions & 7 deletions testsrc/main/mondrian/test/clearview/MetricFilterTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*
* 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.
* You must accept the terms of that agreement to use this software.
*
* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved.
// 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.
// You must accept the terms of that agreement to use this software.
//
// Copyright (c) 2002-2016 Pentaho Corporation.. All rights reserved.
*/

package mondrian.test.clearview;

import mondrian.olap.MondrianProperties;
import mondrian.test.DiffRepository;
import mondrian.util.Bug;

import junit.framework.TestSuite;

Expand Down Expand Up @@ -46,6 +47,16 @@ public static TestSuite suite() {
return constructSuite(getDiffReposStatic(), MetricFilterTest.class);
}

protected void runTest() throws Exception {
if (!Bug.BugMondrian2452Fixed
&& (getName().equals("testMetricFiltersWithNoSubtotals"))
&& !MondrianProperties.instance().EnableNativeCrossJoin.get())
{
// Tests give wrong results if native crossjoin is disabled.
return;
}
super.runTest();
}
}

// End MetricFilterTest.java
26 changes: 19 additions & 7 deletions testsrc/main/mondrian/test/clearview/SummaryMetricPercentTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*
* 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.
* You must accept the terms of that agreement to use this software.
*
* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved.
// 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.
// You must accept the terms of that agreement to use this software.
//
// Copyright (c) 2002-2016 Pentaho Corporation.. All rights reserved.
*/

package mondrian.test.clearview;

import mondrian.olap.MondrianProperties;
import mondrian.test.DiffRepository;
import mondrian.util.Bug;

import junit.framework.TestSuite;

Expand Down Expand Up @@ -48,6 +49,17 @@ public static TestSuite suite() {
SummaryMetricPercentTest.class);
}

@Override
protected void runTest() throws Exception {
if (!Bug.BugMondrian2452Fixed
&& (getName().equals("testSpecialMetricPctOfCol"))
&& !MondrianProperties.instance().EnableNativeCrossJoin.get())
{
// Tests give wrong results if native crossjoin is disabled.
return;
}
super.runTest();
}
}

// End SummaryMetricPercentTest.java
20 changes: 13 additions & 7 deletions testsrc/main/mondrian/test/clearview/SummaryTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
* 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.
* You must accept the terms of that agreement to use this software.
*
* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved.
// 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.
// You must accept the terms of that agreement to use this software.
//
// Copyright (c) 2002-2016 Pentaho Corporation.. All rights reserved.
*/

package mondrian.test.clearview;

import mondrian.olap.MondrianProperties;
Expand Down Expand Up @@ -59,6 +58,13 @@ protected void runTest() throws Exception {
// Tests give wrong results if native crossjoin is disabled.
return;
}
if (!Bug.BugMondrian2452Fixed
&& (getName().equals("testRankExpandNonNative"))
&& !MondrianProperties.instance().EnableNativeCrossJoin.get())
{
// Tests give wrong results if native crossjoin is disabled.
return;
}
super.runTest();
}
}
Expand Down

0 comments on commit 908955f

Please sign in to comment.