Skip to content

Commit

Permalink
JBPM-6510 - Refactor tests to use only one CountDownProcessEventListe…
Browse files Browse the repository at this point in the history
…ner (#1039)
  • Loading branch information
MarianMacik authored and mswiderski committed Oct 24, 2017
1 parent dcac15d commit 0622c52
Show file tree
Hide file tree
Showing 50 changed files with 358 additions and 972 deletions.
10 changes: 5 additions & 5 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Expand Up @@ -38,7 +38,7 @@
import org.jbpm.process.instance.event.listeners.TriggerRulesEventListener; import org.jbpm.process.instance.event.listeners.TriggerRulesEventListener;
import org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler; import org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler;
import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler; import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.jbpm.test.util.CountDownProcessEventListener; import org.jbpm.test.listener.NodeLeftCountDownProcessEventListener;
import org.jbpm.workflow.instance.WorkflowRuntimeException; import org.jbpm.workflow.instance.WorkflowRuntimeException;
import org.jbpm.workflow.instance.node.DynamicNodeInstance; import org.jbpm.workflow.instance.node.DynamicNodeInstance;
import org.jbpm.workflow.instance.node.DynamicUtils; import org.jbpm.workflow.instance.node.DynamicUtils;
Expand Down Expand Up @@ -546,7 +546,7 @@ public Void execute(Context context) {
@Test(timeout=10000) @Test(timeout=10000)
@RequirePersistence @RequirePersistence
public void testProcesWithHumanTaskWithTimer() throws Exception { public void testProcesWithHumanTaskWithTimer() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("Timer", 1); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Timer", 1);
KieBase kbase = createKnowledgeBase("BPMN2-SubProcessWithTimer.bpmn2"); KieBase kbase = createKnowledgeBase("BPMN2-SubProcessWithTimer.bpmn2");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase); StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener); ksession.addEventListener(countDownListener);
Expand Down Expand Up @@ -756,7 +756,7 @@ public void testCallActivityWithHistoryLog() throws Exception {
@Test(timeout=10000) @Test(timeout=10000)
@RequirePersistence @RequirePersistence
public void testCallActivityWithTimer() throws Exception { public void testCallActivityWithTimer() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("Timer", 1); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Timer", 1);
KieBase kbase = createKnowledgeBase("BPMN2-ParentProcess.bpmn2", KieBase kbase = createKnowledgeBase("BPMN2-ParentProcess.bpmn2",
"BPMN2-SubProcessWithTimer.bpmn2"); "BPMN2-SubProcessWithTimer.bpmn2");
ksession = createKnowledgeSession(kbase); ksession = createKnowledgeSession(kbase);
Expand Down Expand Up @@ -1364,7 +1364,7 @@ public void testBusinessRuleTaskWithContionalEvent() throws Exception {
@RequirePersistence @RequirePersistence
@Test(timeout=10000) @Test(timeout=10000)
public void testNullVariableInScriptTaskProcess() throws Exception { public void testNullVariableInScriptTaskProcess() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("Timer", 1, true); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Timer", 1, true);
KieBase kbase = createKnowledgeBase("BPMN2-NullVariableInScriptTaskProcess.bpmn2"); KieBase kbase = createKnowledgeBase("BPMN2-NullVariableInScriptTaskProcess.bpmn2");
ksession = createKnowledgeSession(kbase); ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener); ksession.addEventListener(countDownListener);
Expand Down Expand Up @@ -1396,7 +1396,7 @@ public void testScriptTaskWithVariableByName() throws Exception {


@Test @Test
public void testCallActivityWithBoundaryEvent() throws Exception { public void testCallActivityWithBoundaryEvent() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("Boundary event", 1); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Boundary event", 1);
KieBase kbase = createKnowledgeBase( KieBase kbase = createKnowledgeBase(
"BPMN2-CallActivityWithBoundaryEvent.bpmn2", "BPMN2-CallActivityWithBoundaryEvent.bpmn2",
"BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2"); "BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2");
Expand Down
8 changes: 4 additions & 4 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java
Expand Up @@ -22,7 +22,7 @@
import org.jbpm.process.core.context.variable.VariableScope; import org.jbpm.process.core.context.variable.VariableScope;
import org.jbpm.process.instance.context.variable.VariableScopeInstance; import org.jbpm.process.instance.context.variable.VariableScopeInstance;
import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler; import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.jbpm.test.util.CountDownProcessEventListener; import org.jbpm.test.listener.NodeLeftCountDownProcessEventListener;
import org.jbpm.workflow.instance.impl.NodeInstanceImpl; import org.jbpm.workflow.instance.impl.NodeInstanceImpl;
import org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl; import org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl;
import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; import org.jbpm.workflow.instance.node.CompositeContextNodeInstance;
Expand Down Expand Up @@ -458,7 +458,7 @@ public void testInclusiveSplitAndJoinWithEnd() throws Exception {


@Test(timeout=10000) @Test(timeout=10000)
public void testInclusiveSplitAndJoinWithTimer() throws Exception { public void testInclusiveSplitAndJoinWithTimer() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("timer", 2); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 2);
KieBase kbase = createKnowledgeBase("BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2"); KieBase kbase = createKnowledgeBase("BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2");
ksession = createKnowledgeSession(kbase); ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener); ksession.addEventListener(countDownListener);
Expand Down Expand Up @@ -1358,7 +1358,7 @@ public void testMultiInstanceLoopCharacteristicsTask() throws Exception {


@Test @Test
public void testMultipleInOutgoingSequenceFlows() throws Exception { public void testMultipleInOutgoingSequenceFlows() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("timer", 1); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 1);
System.setProperty("jbpm.enable.multi.con", "true"); System.setProperty("jbpm.enable.multi.con", "true");
KieBase kbase = createKnowledgeBase("BPMN2-MultipleInOutgoingSequenceFlows.bpmn2"); KieBase kbase = createKnowledgeBase("BPMN2-MultipleInOutgoingSequenceFlows.bpmn2");
ksession = createKnowledgeSession(kbase); ksession = createKnowledgeSession(kbase);
Expand Down Expand Up @@ -1517,7 +1517,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) {


@Test @Test
public void testTimerAndGateway() throws Exception { public void testTimerAndGateway() throws Exception {
CountDownProcessEventListener countDownListener = new CountDownProcessEventListener("timer", 1); NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 1);
KieBase kbase = createKnowledgeBase("timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2"); KieBase kbase = createKnowledgeBase("timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2");
ksession = createKnowledgeSession(kbase); ksession = createKnowledgeSession(kbase);
ksession.addEventListener(countDownListener); ksession.addEventListener(countDownListener);
Expand Down

0 comments on commit 0622c52

Please sign in to comment.