Search in sources :

Example 51 with TrackingProcessEventListener

use of org.jbpm.test.listener.TrackingProcessEventListener in project jbpm by kiegroup.

the class EventBasedGatewayTest method testSignal.

/**
 * Signal event branch
 */
@Test(timeout = 30000)
public void testSignal() {
    TrackingProcessEventListener tpel = new TrackingProcessEventListener();
    ksession.addEventListener(tpel);
    List<Command<?>> commands = new ArrayList<Command<?>>();
    commands.add(CommandFactory.newStartProcess(EVENT_BASED_GATEWAY_ID));
    commands.add(CommandFactory.newSignalEvent("sigkill", null));
    ksession.execute(CommandFactory.newBatchExecution(commands));
    TrackingListenerAssert.assertProcessStarted(tpel, EVENT_BASED_GATEWAY_ID);
    TrackingListenerAssert.assertTriggeredAndLeft(tpel, "start");
    TrackingListenerAssert.assertTriggeredAndLeft(tpel, "fork");
    TrackingListenerAssert.assertTriggeredAndLeft(tpel, "sig");
    TrackingListenerAssert.assertTriggeredAndLeft(tpel, "join");
    TrackingListenerAssert.assertTriggered(tpel, "end");
    TrackingListenerAssert.assertProcessCompleted(tpel, EVENT_BASED_GATEWAY_ID);
}
Also used : Command(org.kie.api.command.Command) TrackingProcessEventListener(org.jbpm.test.listener.TrackingProcessEventListener) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

TrackingProcessEventListener (org.jbpm.test.listener.TrackingProcessEventListener)51 Test (org.junit.Test)49 KieSession (org.kie.api.runtime.KieSession)25 IterableProcessEventListener (org.jbpm.test.listener.IterableProcessEventListener)17 Command (org.kie.api.command.Command)16 ArrayList (java.util.ArrayList)13 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)13 BZ (qa.tools.ikeeper.annotation.BZ)9 UserTransaction (javax.transaction.UserTransaction)7 RegisterWorkItemHandlerCommand (org.drools.core.command.runtime.process.RegisterWorkItemHandlerCommand)6 CompleteWorkItemCommand (org.drools.core.command.runtime.process.CompleteWorkItemCommand)5 HashMap (java.util.HashMap)3 TrackingAgendaEventListener (org.jbpm.test.listener.TrackingAgendaEventListener)2 WorkItem (org.kie.api.runtime.process.WorkItem)2 AsyncWorkItemHandler (org.jbpm.executor.impl.wih.AsyncWorkItemHandler)1 JbpmJUnitBaseTestCase (org.jbpm.test.JbpmJUnitBaseTestCase)1 TrackingRuleRuntimeEventListener (org.jbpm.test.listener.TrackingRuleRuntimeEventListener)1 ListWorkItemHandler (org.jbpm.test.wih.ListWorkItemHandler)1 DynamicNodeInstance (org.jbpm.workflow.instance.node.DynamicNodeInstance)1 Before (org.junit.Before)1