Fixed the test for the ParallelMultiDimensionalGroupingProcessor

This commit is contained in:
Lennart Hensler committed 2014-02-24 12:27:21 +01:00
1 parent ee183b4c9c
commit 11200163fb
5 files changed
+66 -30

No files matched your search

@@ -0,0 +1,31 @@
package com.sap.sse.datamining.test.components.util;
import com.sap.sse.datamining.test.util.ConcurrencyTestsUtil;
public class BlockingInstructionWrapper implements Runnable {
private Runnable innerInstruction;
private boolean workIsInProgress;
public BlockingInstructionWrapper(Runnable innerInstruction) {
this.innerInstruction = innerInstruction;
workIsInProgress = true;
}
@Override
public void run() {
while (workIsInProgress) {
ConcurrencyTestsUtil.sleepFor(100);
}
innerInstruction.run();
}
/**
* Tells the instruction, that the work is now done. It won't block it's inner instruction anymore and calls the run method of it.
*/
public void workIsNowFinished() {
workIsInProgress = false;
}
}
@@ -23,6 +23,7 @@ public class Number {
@Dimension("crossSum")
public int getCrossSum() {
int crossSum = 0;
int value = this.value;
while (value != 0) {
crossSum += value % 10;
value /= 10;
@@ -30,4 +31,9 @@ public class Number {
return crossSum;
}
@Override
public String toString() {
return "Number " + value;
}
}