Search in sources :

Example 6 with ThrowBpmnErrorDelegateException

use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.

the class NestedNonInterruptingEventSubprocessNestedSubprocessTest method testInitInnerSubProcessThrowUnhandledException.

@Test
@ScenarioUnderTest("init.innerSubProcess.6")
public void testInitInnerSubProcessThrowUnhandledException() {
    // given
    ProcessInstance instance = rule.processInstance();
    Task innerSubProcessTask = rule.taskQuery().taskDefinitionKey("innerSubProcessTask").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(innerSubProcessTask.getId());
        Assert.fail("should throw a ThrowBpmnErrorDelegateException");
    } catch (ThrowBpmnErrorDelegateException e) {
        Assert.assertEquals("unhandledException", e.getMessage());
    }
}
Also used : Task(org.camunda.bpm.engine.task.Task) ThrowBpmnErrorDelegateException(org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 7 with ThrowBpmnErrorDelegateException

use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.

the class NestedParallelNonInterruptingEventSubprocessScenarioTest method testInitInnerTaskThrowUnhandledException.

@Test
@ScenarioUnderTest("init.innerTask.5")
public void testInitInnerTaskThrowUnhandledException() {
    // 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());
    }
}
Also used : Task(org.camunda.bpm.engine.task.Task) ThrowBpmnErrorDelegateException(org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 8 with ThrowBpmnErrorDelegateException

use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.

the class ParallelNestedNonInterruptingEventSubprocessScenarioTest method testInitInnerTaskThrowUnhandledException.

@Test
@ScenarioUnderTest("init.innerTask.6")
public void testInitInnerTaskThrowUnhandledException() {
    // given
    ProcessInstance instance = rule.processInstance();
    Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();
    Task outerTask = rule.taskQuery().taskDefinitionKey("outerTask").singleResult();
    // when
    rule.getTaskService().complete(outerTask.getId());
    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());
    }
}
Also used : Task(org.camunda.bpm.engine.task.Task) ThrowBpmnErrorDelegateException(org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 9 with ThrowBpmnErrorDelegateException

use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.

the class ParallelNestedNonInterruptingEventSubprocessScenarioTest method testInitThrowUnhandledException.

@Test
@ScenarioUnderTest("init.6")
public void testInitThrowUnhandledException() {
    // given
    ProcessInstance instance = rule.processInstance();
    Task eventSubprocessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();
    Task outerTask = rule.taskQuery().taskDefinitionKey("outerTask").singleResult();
    // when
    rule.getTaskService().complete(outerTask.getId());
    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());
    }
}
Also used : Task(org.camunda.bpm.engine.task.Task) ThrowBpmnErrorDelegateException(org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Example 10 with ThrowBpmnErrorDelegateException

use of org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException in project camunda-bpm-platform by camunda.

the class NestedSequentialMultiInstanceScenarioTest method testInitThrowUnhandledException.

@Test
@ScenarioUnderTest("init.5")
public void testInitThrowUnhandledException() {
    // given
    ProcessInstance instance = rule.processInstance();
    Task innerMiSubProcessTask = rule.taskQuery().taskDefinitionKey("innerSubProcessTask").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(innerMiSubProcessTask.getId());
        Assert.fail("should throw a ThrowBpmnErrorDelegateException");
    } catch (ThrowBpmnErrorDelegateException e) {
        Assert.assertEquals("unhandledException", e.getMessage());
    }
}
Also used : Task(org.camunda.bpm.engine.task.Task) ThrowBpmnErrorDelegateException(org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest) ScenarioUnderTest(org.camunda.bpm.qa.upgrade.ScenarioUnderTest)

Aggregations

ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)19 ScenarioUnderTest (org.camunda.bpm.qa.upgrade.ScenarioUnderTest)19 ThrowBpmnErrorDelegateException (org.camunda.bpm.qa.upgrade.util.ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException)19 Test (org.junit.Test)19 Task (org.camunda.bpm.engine.task.Task)15