Skip to content

Commit

Permalink
MONDRIAN: Integrates change 15014 into 3.4.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian-release/3.4/": change = 15014]
  • Loading branch information
lucboudreau committed Mar 15, 2012
1 parent e4fdf78 commit f43957d
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions testsrc/main/mondrian/rolap/FastBatchingCellReaderTest.java
Expand Up @@ -34,10 +34,13 @@ public class FastBatchingCellReaderTest extends BatchTestCase {
private Locus locus;
private Execution e;
private AggregationManager aggMgr;
private RolapCube salesCube;

@Override
protected void setUp() throws Exception {
super.setUp();
getTestContext().getConnection()
.getCacheControl(null).flushSchemaCache();
final Statement statement =
((RolapConnection) getTestContext().getConnection())
.getInternalStatement();
Expand All @@ -48,11 +51,19 @@ protected void setUp() throws Exception {
.getServer().getAggregationManager();
locus = new Locus(e, "FastBatchingCellReaderTest", null);
Locus.push(locus);
salesCube = (RolapCube)
getTestContext().getConnection().getSchemaReader()
.withLocus().getCubes()[0];
}

@Override
protected void tearDown() throws Exception {
Locus.pop(locus);
// cleanup
e = null;
aggMgr = null;
locus = null;
salesCube = null;
super.tearDown();
}

Expand All @@ -66,8 +77,7 @@ private BatchLoader createFbcr(
}
return new BatchLoader(
Locus.peek(),
e.getMondrianStatement().getMondrianConnection()
.getServer().getAggregationManager().cacheMgr,
aggMgr.cacheMgr,
dialect,
cube);
}
Expand Down Expand Up @@ -192,10 +202,6 @@ Dialect getDialect() {
}
}

private RolapCube salesCube = (RolapCube)
getTestContext().getConnection().getSchemaReader()
.withLocus().getCubes()[0];

public void testGroupBatchesForNonGroupableBatchesWithSorting() {
final BatchLoader fbcr = createFbcr(null, salesCube);
BatchLoader.Batch genderBatch = fbcr.new Batch(
Expand Down Expand Up @@ -1070,8 +1076,6 @@ public void testCanBatchForBatchWithDifferentAggregationTable() {
// tables, so this test will fail.
return;
}
propSaver.set(propSaver.properties.UseAggregates, true);
propSaver.set(propSaver.properties.ReadAggregates, true);

final BatchLoader fbcr = createFbcr(null, salesCube);

Expand All @@ -1093,8 +1097,15 @@ public void testCanBatchForBatchWithDifferentAggregationTable() {
cubeNameSales,
measureUnitSales);

assertFalse(detailedBatch.canBatch(summaryBatch));
assertFalse(summaryBatch.canBatch(detailedBatch));
if (MondrianProperties.instance().UseAggregates.get()
&& MondrianProperties.instance().ReadAggregates.get())
{
assertFalse(detailedBatch.canBatch(summaryBatch));
assertFalse(summaryBatch.canBatch(detailedBatch));
} else {
assertTrue(detailedBatch.canBatch(summaryBatch));
assertFalse(summaryBatch.canBatch(detailedBatch));
}
}

public void testCannotBatchTwoBatchesAtTheSameLevel() {
Expand Down

0 comments on commit f43957d

Please sign in to comment.