Buggy code:
@ RunWith ( BMUnitRunner . class ) public class OperationSequencesTestCase extends OperationTestCaseBase { static final ModelNode addSubsystemOp = getSubsystemAddOperation ( "maximal2" ) ; static final ModelNode removeSubsystemOp = getSubsystemRemoveOperation ( ) ; static final ModelNode addStackOp = getProtocolStackAddOperation ( "maximal2" ) ; static final ModelNode addStackOpWithParams = getProtocolStackAddOperationWithParameters ( "maximal2" ) ; static final ModelNode removeStackOp = getProtocolStackRemoveOperation ( "maximal2" ) ; static final ModelNode addTransportOp = getTransportAddOperation ( "maximal2" , "UDP" ) ; static final ModelNode addTransportOpWithProps = getTransportAddOperationWithProperties ( "maximal2" , "UDP" ) ; static final ModelNode removeTransportOp = getTransportRemoveOperation ( "maximal2" , "UDP" ) ; static final ModelNode addProtocolOp = getProtocolAddOperation ( "maximal2" , "MPING" ) ; static final ModelNode addProtocolOpWithProps = getProtocolAddOperationWithProperties ( "maximal2" , "MPING" ) ; static final ModelNode removeProtocolOp = getProtocolRemoveOperation ( "maximal2" , "MPING" ) ; @ Test public void testProtocolStackAddRemoveAddSequence ( ) throws Exception { } @ Test public void testProtocolStackRemoveRemoveSequence ( ) throws Exception { } @ Test public void testProtocolStackAddRemoveSequenceWithParameters ( ) throws Exception { } @ Test <START_BUG> @ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.jgroups.subsystem.ProtocolStackRemove" , targetMethod = "performRuntime" , targetLocation = "AT<seq2seq4repair_space>EXIT" , action = "traceln(\"Injecting<seq2seq4repair_space>rollback<seq2seq4repair_space>fault<seq2seq4repair_space>via<seq2seq4repair_space>Byteman\");$1.setRollbackOnly()" ) <END_BUG> public void testProtocolStackRemoveRollback ( ) throws Exception { String subsystemXml = getSubsystemXml ( ) ; KernelServices servicesA = createKernelServicesBuilder ( null ) . setSubsystemXml ( subsystemXml ) . build ( ) ; ModelNode [ ] batchToAddStack = new ModelNode [ ] { OperationSequencesTestCase . addStackOp , OperationSequencesTestCase . addTransportOp , OperationSequencesTestCase . addProtocolOp } ; ModelNode compositeOp = getCompositeOperation ( batchToAddStack ) ; ModelNode result = servicesA . executeOperation ( compositeOp ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; result = servicesA . executeOperation ( OperationSequencesTestCase . removeStackOp ) ; Assert . assertEquals ( FAILED , result . get ( OUTCOME ) . asString ( ) ) ; ServiceName channelFactoryServiceName = ChannelFactoryService . getServiceName ( "maximal2" ) ; Assert . assertNotNull ( "channel<seq2seq4repair_space>factory<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( channelFactoryServiceName ) ) ; } private void listMSCServices ( KernelServices services , String marker ) { } private boolean isMSCServicePresent ( KernelServices services , ServiceName serviceName ) { } }

Fix:
@ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.jgroups.subsystem.StackRemoveHandler" , targetMethod = "performRuntime" , targetLocation = "AT<seq2seq4repair_space>EXIT" , action = "traceln(\"Injecting<seq2seq4repair_space>rollback<seq2seq4repair_space>fault<seq2seq4repair_space>via<seq2seq4repair_space>Byteman\");$1.setRollbackOnly()" )