diff --git a/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py b/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py index 692f4194..6e549784 100644 --- a/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py +++ b/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py @@ -19,7 +19,7 @@ class EventBsedGatewayTest(BpmnWorkflowTestCase): def testEventBasedGatewaySaveRestore(self): self.actual_test(True) - + def actual_test(self, save_restore=False): self.workflow.do_engine_steps() @@ -36,6 +36,20 @@ class EventBsedGatewayTest(BpmnWorkflowTestCase): self.assertEqual(self.workflow.get_tasks_from_spec_name('message_2_event')[0].state, TaskState.CANCELLED) self.assertEqual(self.workflow.get_tasks_from_spec_name('timer_event')[0].state, TaskState.CANCELLED) + def testTimeout(self): + + self.workflow.do_engine_steps() + waiting_tasks = self.workflow.get_waiting_tasks() + self.assertEqual(len(waiting_tasks), 1) + timer_event = waiting_tasks[0].task_spec.event_definition.event_definitions[-1] + self.workflow.catch(timer_event) + self.workflow.refresh_waiting_tasks() + self.workflow.do_engine_steps() + self.assertEqual(self.workflow.is_completed(), True) + self.assertEqual(self.workflow.get_tasks_from_spec_name('message_1_event')[0].state, TaskState.CANCELLED) + self.assertEqual(self.workflow.get_tasks_from_spec_name('message_2_event')[0].state, TaskState.CANCELLED) + self.assertEqual(self.workflow.get_tasks_from_spec_name('timer_event')[0].state, TaskState.COMPLETED) + def testMultipleStart(self): spec, subprocess = self.load_workflow_spec('multiple-start-parallel.bpmn', 'main') workflow = BpmnWorkflow(spec)