use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.
the class NestedParallelNonInterruptingEventSubprocessScenarioTest method testInitThrowUnhandledException.
@Test
@ScenarioUnderTest("init.6")
public void testInitThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask1").singleResult();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.getTaskService().complete(eventSubprocessTask.getId());
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.
the class SequentialMultiInstanceScenarioTest method testInitNonInterruptingBoundaryEventThrowUnhandledException.
@Test
@ScenarioUnderTest("initNonInterruptingBoundaryEvent.7")
public void testInitNonInterruptingBoundaryEventThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task miSubprocessTask = rule.taskQuery().taskDefinitionKey("subProcessTask").list().get(0);
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.getTaskService().complete(miSubprocessTask.getId());
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnInnerSubprocessScenarioTest method testInitMessageThrowUnhandledException.
@Test
@ScenarioUnderTest("initMessage.7")
public void testInitMessageThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.messageCorrelation("ReceiveTaskMessage").correlate();
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitMessageThrowUnhandledException.
@Test
@ScenarioUnderTest("initMessage.7")
public void testInitMessageThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
// when
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
rule.getRuntimeService().setVariable(instance.getId(), ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
// then
try {
rule.messageCorrelation("ReceiveTaskMessage").correlate();
Assert.fail("should throw a ThrowBpmnErrorDelegateException");
} catch (ThrowBpmnErrorDelegateException e) {
Assert.assertEquals("unhandledException", e.getMessage());
}
}
Aggregations