use of org.jbpm.test.listener.IterableProcessEventListener in project jbpm by kiegroup.
the class StartEventTest method testConditionalStartEvent.
@Test(timeout = 30000)
public void testConditionalStartEvent() {
KieSession ksession = createKSession(CONDITIONAL);
IterableProcessEventListener events = new IterableProcessEventListener();
TrackingProcessEventListener process = new TrackingProcessEventListener();
ksession.addEventListener(events);
ksession.addEventListener(process);
List<Command<?>> cmds = new ArrayList<Command<?>>();
cmds.add(getCommands().newInsert("condition"));
cmds.add(getCommands().newFireAllRules());
ksession.execute(getCommands().newBatchExecution(cmds, null));
Assertions.assertThat(process.wasProcessStarted(CONDITIONAL_ID)).isTrue();
Assertions.assertThat(process.wasProcessCompleted(CONDITIONAL_ID)).isTrue();
assertProcessStarted(events, CONDITIONAL_ID);
assertNextNode(events, "start");
assertNextNode(events, "script");
assertNextNode(events, "end");
assertProcessCompleted(events, CONDITIONAL_ID);
Assertions.assertThat(events.hasNext()).isFalse();
}
use of org.jbpm.test.listener.IterableProcessEventListener in project jbpm by kiegroup.
the class StartEventTest method testNoneStartEvent.
@Test(timeout = 30000)
public void testNoneStartEvent() {
KieSession ksession = createKSession(NONE);
IterableProcessEventListener events = new IterableProcessEventListener();
TrackingProcessEventListener process = new TrackingProcessEventListener();
ksession.addEventListener(events);
ksession.addEventListener(process);
Command<?> cmd = getCommands().newStartProcess(NONE_ID);
ksession.execute(cmd);
Assertions.assertThat(process.wasProcessStarted(NONE_ID)).isTrue();
Assertions.assertThat(process.wasProcessCompleted(NONE_ID)).isTrue();
assertProcessStarted(events, NONE_ID);
assertNextNode(events, "start");
assertNextNode(events, "script");
assertNextNode(events, "end");
assertProcessCompleted(events, NONE_ID);
Assertions.assertThat(events.hasNext()).isFalse();
}
use of org.jbpm.test.listener.IterableProcessEventListener in project jbpm by kiegroup.
the class StartEventTest method testMessageStartEvent.
@Test(timeout = 30000)
public void testMessageStartEvent() {
KieSession ksession = createKSession(MESSAGE);
IterableProcessEventListener events = new IterableProcessEventListener();
TrackingProcessEventListener process = new TrackingProcessEventListener();
ksession.addEventListener(events);
ksession.addEventListener(process);
Command<?> cmd = getCommands().newSignalEvent("Message-type", null);
ksession.execute(cmd);
Assertions.assertThat(process.wasProcessStarted(MESSAGE_ID)).isTrue();
Assertions.assertThat(process.wasProcessCompleted(MESSAGE_ID)).isTrue();
assertProcessStarted(events, MESSAGE_ID);
assertNextNode(events, "start");
assertNextNode(events, "script");
assertNextNode(events, "end");
assertProcessCompleted(events, MESSAGE_ID);
Assertions.assertThat(events.hasNext()).isFalse();
}
use of org.jbpm.test.listener.IterableProcessEventListener in project jbpm by kiegroup.
the class InclusiveGatewayTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
kieSession = createKSession(INCLUSIVE_GATEWAY);
iterableListener = new IterableProcessEventListener();
}
Aggregations