Examples of FailingDeploymentOperationStep


Examples of org.camunda.bpm.container.impl.jmx.kernel.util.FailingDeploymentOperationStep

  public void testFailingDeploymentOperation() {

    try {
      serviceContainer.createDeploymentOperation("test failing op")
        .addStep(new StartServiceDeploymentOperationStep(service1Name, service1))
        .addStep(new FailingDeploymentOperationStep())                               // <- this step fails
        .addStep(new StartServiceDeploymentOperationStep(service2Name, service2))
        .execute();

      fail("Exception expected");

    } catch(Exception e) {
      assertTrue(e.getMessage().contains("Exception while performing 'test failing op => failing step'"));

    }

    // none of the services were registered
    assertNull(serviceContainer.getService(service1ObjectName));
    assertNull(serviceContainer.getService(service2ObjectName));

    // different step ordering //////////////////////////////////

    try {
      serviceContainer.createDeploymentOperation("test failing op")
        .addStep(new StartServiceDeploymentOperationStep(service1Name, service1))
        .addStep(new StartServiceDeploymentOperationStep(service2Name, service2))
        .addStep(new FailingDeploymentOperationStep())                               // <- this step fails
        .execute();

      fail("Exception expected");

    } catch(Exception e) {
View Full Code Here

Examples of org.camunda.bpm.container.impl.jmx.kernel.util.FailingDeploymentOperationStep

    serviceContainer.startService(service2Name, service2);

    // run a composite undeployment operation with a failing step
    serviceContainer.createUndeploymentOperation("test failing op")
      .addStep(new StopServiceDeploymentOperationStep(service1Name))
      .addStep(new FailingDeploymentOperationStep())                               // <- this step fails
      .addStep(new StopServiceDeploymentOperationStep(service2Name))
      .execute(); // this does not throw an exception even if some steps fail. (exceptions are logged)


    // both services were stopped.
    assertNull(serviceContainer.getService(service1ObjectName));
    assertNull(serviceContainer.getService(service2ObjectName));

    // different step ordering //////////////////////////////////

    serviceContainer.startService(service1Name, service1);
    serviceContainer.startService(service2Name, service2);

    // run a composite undeployment operation with a failing step
    serviceContainer.createUndeploymentOperation("test failing op")
      .addStep(new FailingDeploymentOperationStep())                               // <- this step fails
      .addStep(new StopServiceDeploymentOperationStep(service1Name))
      .addStep(new StopServiceDeploymentOperationStep(service2Name))
      .execute();

    // both services were stopped.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.