serviceContainer.startService(service1Name, service1);
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.
assertNull(serviceContainer.getService(service1ObjectName));
assertNull(serviceContainer.getService(service2ObjectName));