use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingEventSubprocessScenarioTest method testInitThrowUnhandledException.
@Test
@ScenarioUnderTest("init.6")
public void testInitThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").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 NestedNonInterruptingEventSubprocessScenarioTest method testInitTask1ThrowUnhandledException.
@Test
@ScenarioUnderTest("init.innerTask.5")
public void testInitTask1ThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task eventSubprocessTask = rule.taskQuery().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 TwoLevelNestedNonInterruptingEventSubprocessScenarioTest method testInitLevel1ThrowUnhandledException.
@Test
@ScenarioUnderTest("initLevel1.7")
public void testInitLevel1ThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
rule.messageCorrelation("InnerEventSubProcessMessage").correlate();
Task innerEventSubprocessTask = rule.taskQuery().taskDefinitionKey("innerEventSubProcessTask").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(innerEventSubprocessTask.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 TwoLevelNestedNonInterruptingEventSubprocessScenarioTest method testInitLevel1InitLevel2ThrowUnhandledException.
@Test
@ScenarioUnderTest("initLevel1.initLevel2.7")
public void testInitLevel1InitLevel2ThrowUnhandledException() {
// given
ProcessInstance instance = rule.processInstance();
Task innerEventSubprocessTask = rule.taskQuery().taskDefinitionKey("innerEventSubProcessTask").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(innerEventSubprocessTask.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 NestedNonInterruptingBoundaryEventOnOuterSubprocessScenarioTest method testInitTimerThrowUnhandledException.
@Test
@ScenarioUnderTest("initTimer.7")
public void testInitTimerThrowUnhandledException() {
// 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