mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
Fixed the test for the ParallelMultiDimensionalGroupingProcessor
This commit is contained in:
1 parent
ee183b4c9c
commit
11200163fb
5 files changed
+66
-30
No files matched your search
+31
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user