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");