@org.junit.Ignore("This fails for some mysterious reason - but this isn't a critical test") @Test @BMRule( name = "Test remove rollback operation", targetClass = "org.jboss.as.clustering.jgroups.subsystem.StackRemoveHandler", targetMethod = "performRuntime", targetLocation = "AT EXIT", action = "traceln(\"Injecting rollback fault via Byteman\");$1.setRollbackOnly()") public void testProtocolStackRemoveRollback() throws Exception { KernelServices services = buildKernelServices(); ModelNode operation = Operations.createCompositeOperation(addStackOp, addTransportOp, addProtocolOp); // add a protocol stack ModelNode result = services.executeOperation(operation); Assert.assertEquals(SUCCESS, result.get(OUTCOME).asString()); // remove the protocol stack // the remove has OperationContext.setRollbackOnly() injected // and so is expected to fail result = services.executeOperation(removeStackOp); Assert.assertEquals(FAILED, result.get(OUTCOME).asString()); // need to check that all services are correctly re-installed ServiceName channelFactoryServiceName = ProtocolStackServiceName.CHANNEL_FACTORY.getServiceName("maximal2"); Assert.assertNotNull( "channel factory service not installed", services.getContainer().getService(channelFactoryServiceName)); }
@Override public ServiceName getServiceName() { return ProtocolStackServiceName.CHANNEL_FACTORY .getServiceName(this.stackName) .append(this.name); }