提交 98f3512f 编写于 作者: M meyerd

ACT-1092 adding test coverage for exceptional cases

上级 ecef83ba
......@@ -380,6 +380,33 @@ public class RuntimeServiceTest extends PluggableActivitiTestCase {
}
}
public void testSignalEventReceivedNonExistingExecution() {
try {
runtimeService.signalEventReceived("alert", "nonexistingExecution");
fail("exeception expected");
}catch (ActivitiException e) {
// this is good
assertTrue(e.getMessage().contains("Execution 'nonexistingExecution' has not subscribed to a signal event with name 'alert'"));
}
}
@Deployment(resources={
"org/activiti/engine/test/api/runtime/RuntimeServiceTest.catchAlertSignal.bpmn20.xml"
})
public void testExecutionWaitingForDifferentSignal() {
runtimeService.startProcessInstanceByKey("catchAlertSignal");
Execution execution = runtimeService.createExecutionQuery()
.signalEventSubscription("alert")
.singleResult();
try {
runtimeService.signalEventReceived("bogusSignal", execution.getId());
fail("exeception expected");
}catch (ActivitiException e) {
// this is good
assertTrue(e.getMessage().contains("has not subscribed to a signal event with name 'bogusSignal'"));
}
}
private void startSignalCatchProcesses() {
for (int i = 0; i < 3; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册