Skip to content

Commit 41e9845

Browse files
committed
fix tests
1 parent 4234e8f commit 41e9845

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed

jbpm/jbpm-flow-builder/src/main/java/org/jbpm/test/util/NodeLeftCountDownProcessEventListener.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,17 @@
2020

2121
import org.kie.api.event.process.ProcessNodeLeftEvent;
2222

23-
public class NodeLeftCountDownProcessEventListener extends NodeCountDownProcessEventListener {
23+
public class NodeLeftCountDownProcessEventListener extends DefaultCountDownProcessEventListener {
2424

25-
private boolean reactOnBeforeNodeLeft = false;
25+
private String nodeName;
2626

2727
public NodeLeftCountDownProcessEventListener() {
2828

2929
}
3030

3131
public NodeLeftCountDownProcessEventListener(String nodeName, int threads) {
32-
super(nodeName, threads);
33-
}
34-
35-
public NodeLeftCountDownProcessEventListener(String nodeName, int threads, boolean reactOnBeforeNodeLeft) {
36-
super(nodeName, threads);
37-
this.reactOnBeforeNodeLeft = reactOnBeforeNodeLeft;
32+
super(threads);
33+
this.nodeName = nodeName;
3834
}
3935

4036
@Override
@@ -43,11 +39,4 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) {
4339
countDown();
4440
}
4541
}
46-
47-
@Override
48-
public void beforeNodeLeft(ProcessNodeLeftEvent event) {
49-
if (reactOnBeforeNodeLeft && nodeName.equals(event.getNodeInstance().getNodeName())) {
50-
countDown();
51-
}
52-
}
5342
}

jbpm/jbpm-flow-builder/src/main/java/org/jbpm/test/util/NodeCountDownProcessEventListener.java renamed to jbpm/jbpm-flow-builder/src/main/java/org/jbpm/test/util/NodeTriggeredProcessEventListener.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,26 @@
1818
*/
1919
package org.jbpm.test.util;
2020

21-
import java.util.concurrent.CountDownLatch;
22-
2321
import org.kie.api.event.process.ProcessNodeTriggeredEvent;
2422

25-
public class NodeCountDownProcessEventListener extends DefaultCountDownProcessEventListener {
23+
public class NodeTriggeredProcessEventListener extends DefaultCountDownProcessEventListener {
2624

2725
protected String nodeName;
2826

29-
public NodeCountDownProcessEventListener() {
27+
public NodeTriggeredProcessEventListener() {
3028

3129
}
3230

3331
@Override
34-
public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
32+
public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
3533
if (nodeName.equals(event.getNodeInstance().getNodeName())) {
3634
countDown();
3735
}
3836
}
3937

40-
public NodeCountDownProcessEventListener(String nodeName, int threads) {
38+
public NodeTriggeredProcessEventListener(String nodeName, int threads) {
4139
super(threads);
4240
this.nodeName = nodeName;
4341
}
4442

45-
public void reset(String nodeName, int threads) {
46-
this.nodeName = nodeName;
47-
this.latch = new CountDownLatch(threads);
48-
}
4943
}

jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import org.jbpm.process.instance.event.listeners.RuleAwareProcessEventListener;
4949
import org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler;
5050
import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler;
51-
import org.jbpm.test.util.NodeCountDownProcessEventListener;
5251
import org.jbpm.test.util.NodeLeftCountDownProcessEventListener;
5352
import org.jbpm.test.util.ProcessCompletedCountDownProcessEventListener;
5453
import org.jbpm.test.utils.ProcessTestHelper;
@@ -113,7 +112,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
113112
@Test
114113
public void testBoundaryTimerCycleISO() {
115114
Application app = ProcessTestHelper.newApplication();
116-
NodeCountDownProcessEventListener listener = new NodeCountDownProcessEventListener("Send Update", 3);
115+
NodeLeftCountDownProcessEventListener listener = new NodeLeftCountDownProcessEventListener("Send Update", 3);
117116
ProcessTestHelper.registerProcessEventListener(app, listener);
118117
org.kie.kogito.process.Process<BoundaryTimerCycleISOModel> definition = BoundaryTimerCycleISOProcess.newProcess(app);
119118
org.kie.kogito.process.ProcessInstance<BoundaryTimerCycleISOModel> instance = definition.createInstance(definition.createModel());
@@ -126,7 +125,7 @@ public void testBoundaryTimerCycleISO() {
126125
@Test
127126
public void testBoundaryTimerCycleISOVariable() {
128127
Application app = ProcessTestHelper.newApplication();
129-
NodeCountDownProcessEventListener listener = new NodeCountDownProcessEventListener("Send Update", 3);
128+
NodeLeftCountDownProcessEventListener listener = new NodeLeftCountDownProcessEventListener("Send Update", 3);
130129
ProcessTestHelper.registerProcessEventListener(app, listener);
131130
org.kie.kogito.process.Process<BoundaryTimerCycleISOVariableModel> definition = BoundaryTimerCycleISOVariableProcess.newProcess(app);
132131
BoundaryTimerCycleISOVariableModel model = definition.createModel();

0 commit comments

Comments
 (0)