use of org.drools.core.phreak.PhreakNotNode in project drools by kiegroup.
the class Scenario method run.
public Scenario run() {
previousResultTuples = bm.getSegmentMemory().getFirst().getStagedLeftTuples();
actualResultLeftTuples = new TupleSetsImpl<LeftTuple>();
if (phreakNode == PhreakJoinNode.class) {
new PhreakJoinNode().doNode((JoinNode) betaNode, sinkNode, bm, wm, leftTuples, actualResultLeftTuples, previousResultTuples);
} else if (phreakNode == PhreakNotNode.class) {
new PhreakNotNode().doNode((NotNode) betaNode, sinkNode, bm, wm, leftTuples, actualResultLeftTuples, previousResultTuples);
} else if (phreakNode == PhreakExistsNode.class) {
new PhreakExistsNode().doNode((ExistsNode) betaNode, sinkNode, bm, wm, leftTuples, actualResultLeftTuples, previousResultTuples);
}
if (expectedResultBuilder != null) {
assertEquals(expectedResultBuilder.get(), actualResultLeftTuples, expectedResultBuilder.isTestStagedInsert(), expectedResultBuilder.isTestStagedDelete(), expectedResultBuilder.isTestStagedUpdate());
}
if (!preStagedBuilders.isEmpty()) {
for (StagedBuilder stagedBuilder : preStagedBuilders) {
TupleSets<LeftTuple> expected = stagedBuilder.get();
TupleSets<LeftTuple> actual = stagedBuilder.getSegmentMemory().getStagedLeftTuples();
assertEquals(expected, actual, stagedBuilder.isTestStagedInsert(), stagedBuilder.isTestStagedDelete(), stagedBuilder.isTestStagedUpdate());
}
}
SegmentMemory smem = bm.getSegmentMemory();
SegmentPropagator.propagate(smem, actualResultLeftTuples, wm);
if (testLeftMemory) {
equalsLeftMemory(leftMemory);
}
if (testRightMemory) {
equalsRightMemory(rightMemory);
}
if (!postStagedBuilders.isEmpty()) {
for (StagedBuilder stagedBuilder : postStagedBuilders) {
TupleSets<LeftTuple> expected = stagedBuilder.get();
TupleSets<LeftTuple> actual = stagedBuilder.getSegmentMemory().getStagedLeftTuples();
assertEquals(expected, actual, stagedBuilder.isTestStagedInsert(), stagedBuilder.isTestStagedDelete(), stagedBuilder.isTestStagedUpdate());
}
}
return this;
}
use of org.drools.core.phreak.PhreakNotNode in project drools by kiegroup.
the class Scenario method run.
public Scenario run() {
previousResultTuples = bm.getSegmentMemory().getFirst().getStagedLeftTuples();
actualResultLeftTuples = new TupleSetsImpl<LeftTuple>();
if (phreakNode == PhreakJoinNode.class) {
new PhreakJoinNode().doNode((JoinNode) betaNode, sinkNode, bm, wm, leftTuples, actualResultLeftTuples, previousResultTuples);
} else if (phreakNode == PhreakNotNode.class) {
new PhreakNotNode().doNode((NotNode) betaNode, sinkNode, bm, wm, leftTuples, actualResultLeftTuples, previousResultTuples);
} else if (phreakNode == PhreakExistsNode.class) {
new PhreakExistsNode().doNode((ExistsNode) betaNode, sinkNode, bm, wm, leftTuples, actualResultLeftTuples, previousResultTuples);
}
if (expectedResultBuilder != null) {
assertEquals(expectedResultBuilder.get(), actualResultLeftTuples, expectedResultBuilder.isTestStagedInsert(), expectedResultBuilder.isTestStagedDelete(), expectedResultBuilder.isTestStagedUpdate());
}
if (!preStagedBuilders.isEmpty()) {
for (StagedBuilder stagedBuilder : preStagedBuilders) {
TupleSets<LeftTuple> expected = stagedBuilder.get();
TupleSets<LeftTuple> actual = stagedBuilder.getSegmentMemory().getStagedLeftTuples();
assertEquals(expected, actual, stagedBuilder.isTestStagedInsert(), stagedBuilder.isTestStagedDelete(), stagedBuilder.isTestStagedUpdate());
}
}
SegmentMemory smem = bm.getSegmentMemory();
SegmentPropagator.propagate(smem, actualResultLeftTuples, wm);
if (testLeftMemory) {
equalsLeftMemory(leftMemory);
}
if (testRightMemory) {
equalsRightMemory(rightMemory);
}
if (!postStagedBuilders.isEmpty()) {
for (StagedBuilder stagedBuilder : postStagedBuilders) {
TupleSets<LeftTuple> expected = stagedBuilder.get();
TupleSets<LeftTuple> actual = stagedBuilder.getSegmentMemory().getStagedLeftTuples();
assertEquals(expected, actual, stagedBuilder.isTestStagedInsert(), stagedBuilder.isTestStagedDelete(), stagedBuilder.isTestStagedUpdate());
}
}
return this;
}
Aggregations