Buggy code:
} ; private ModelNode model ; private ServiceContainer container ; private ModelController controller ; @ Before public void setupController ( ) throws InterruptedException { } @ After public void shutdownServiceContainer ( ) { } @ Test public void testGetModelDescription ( ) throws Exception { } @ Test public void testSimpleThreadFactory ( ) throws Exception { } @ Test public void testSimpleThreadFactoryInvalidPriorityValue ( ) throws Exception { } @ Test public void testFullThreadFactory ( ) throws Exception { } private void checkFullTreadFactory ( ) { } @ Test public void testSeveralThreadFactories ( ) throws Exception { } @ Test public void testSimpleUnboundedQueueThreadPool ( ) throws Exception { } @ Test public void testSimpleUnboundedQueueThreadPool1_0 ( ) throws Exception { } @ Test public void testFullUnboundedQueueThreadPool ( ) throws Exception { } @ Test public void testFullUnboundedQueueThreadPool1_0 ( ) throws Exception { } private void checkFullUnboundedThreadPool ( ) throws Exception { } @ Test public void testSeveralUnboundedQueueThreadPools ( ) throws Exception { } @ Test public void testSeveralUnboundedQueueThreadPools1_0 ( ) throws Exception { } @ Test public void testSimpleScheduledThreadPool ( ) throws Exception { } @ Test public void testSimpleScheduledThreadPool1_0 ( ) throws Exception { } @ Test public void testFullScheduledThreadPool ( ) throws Exception { } @ Test public void testFullScheduledThreadPool1_0 ( ) throws Exception { } private void checkFullScheduledThreadPool ( ) throws Exception { } @ Test public void testSeveralScheduledThreadPools ( ) throws Exception { } @ Test public void testSeveralScheduledThreadPools1_0 ( ) throws Exception { } @ Test public void testSimpleQueuelessThreadPool ( ) throws Exception { } @ Test public void testSimpleQueuelessThreadPool1_0 ( ) throws Exception { } @ Test public void testFullQueuelessThreadPool ( ) throws Exception { } @ Test public void testFullQueuelessThreadPool1_0 ( ) throws Exception { } private void checkFullQueuelessThreadPool ( ) throws Exception { } @ Test public void testSeveralQueuelessThreadPools ( ) throws Exception { } @ Test public void testSimpleBlockingQueuelessThreadPool ( ) throws Exception { } @ Test public void testSimpleBlockingQueuelessThreadPool1_0 ( ) throws Exception { } @ Test public void testFullBlockingQueuelessThreadPool ( ) throws Exception { } @ Test public void testFullBlockingQueuelessThreadPool1_0 ( ) throws Exception { } private void checkFullBlockingQueuelessThreadPool ( ) throws Exception { } @ Test public void testSeveralBlockingQueuelessThreadPools ( ) throws Exception { } @ Test public void testSeveralQueuelessThreadPools1_0 ( ) throws Exception { } @ Test public void testSimpleBoundedQueueThreadPool ( ) throws Exception { } @ Test public void testSimpleBoundedQueueThreadPool1_0 ( ) throws Exception { } @ Test public void testFullBoundedQueueThreadPool ( ) throws Exception { } @ Test public void testFullBoundedQueueThreadPool1_0 ( ) throws Exception { } private void checkFullBoundedQueueThreadPool ( ) throws Exception { } @ Test public void testSeveralBoundedQueueThreadPools ( ) throws Exception { } @ Test public void testSeveralBoundedQueueThreadPools1_0 ( ) throws Exception { } @ Test public void testSimpleBlockingBoundedQueueThreadPool ( ) throws Exception { } @ Test public void testSimpleBlockingBoundedQueueThreadPool1_0 ( ) throws Exception { } @ Test public void testFullBlockingBoundedQueueThreadPool ( ) throws Exception { } @ Test public void testFullBlockingBoundedQueueThreadPool1_0 ( ) throws Exception { } private void checkFullBlockingBoundedQueueThreadPool ( ) throws Exception { } @ Test public void testSeveralBlockingBoundedQueueThreadPools ( ) throws Exception { } @ Test public void testSeveralBlockingBoundedQueueThreadPools1_0 ( ) throws Exception { } private ModelNode createOperation ( String operationName , String ... address ) { } static class TestExtensionContext implements ExtensionContext { final ManagementResourceRegistration testProfileRegistration ; ManagementResourceRegistration createdRegistration ; SubsystemTransformer modelTransformer ; TestExtensionContext ( ManagementResourceRegistration testProfileRegistration ) { } @ Override public ProcessType getProcessType ( ) { } @ Override public RunningMode getRunningMode ( ) { } @ Override public boolean isRuntimeOnlyRegistrationValid ( ) { } @ Override public PathManager getPathManager ( ) { } @ Override public SubsystemRegistration registerSubsystem ( final String name , final int majorVersion , final int minorVersion ) { } @ Override public SubsystemRegistration registerSubsystem ( final String name , final int majorVersion , final int minorVersion , final int microVersion ) { } } static List < ModelNode > createSubSystem ( String subsystemContents ) throws XMLStreamException { } static List < ModelNode > createSubSystem ( String subsystemContents , Namespace namespace ) throws XMLStreamException { } public class ModelControllerService extends AbstractControllerService { private final CountDownLatch latch = new CountDownLatch ( 1 ) ; ModelControllerService ( final ControlledProcessState processState ) { } @ Override public void start ( StartContext context ) throws StartException { } protected void initModel ( Resource rootResource , ManagementResourceRegistration rootRegistration ) { GlobalOperationHandlers . registerGlobalOperations ( rootRegistration , processType ) ; rootRegistration . registerOperationHandler ( "setup" , new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . createResource ( EMPTY_ADDRESS . append ( PathElement . pathElement ( "profile" , "test" ) ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } } , new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { return new ModelNode ( ) ; } } ) ; ManagementResourceRegistration profileRegistration = rootRegistration . registerSubModel ( PathElement . pathElement ( "profile" ) , ThreadsSubsystemTestCase . profileDescriptionProvider ) ; ThreadsSubsystemTestCase . TestExtensionContext context = new ThreadsSubsystemTestCase . TestExtensionContext ( profileRegistration ) ; ThreadsExtension extension = new ThreadsExtension ( ) ; extension . initialize ( context ) ; Assert . assertNotNull ( context . createdRegistration ) ; } } private class TestConfigurationPersister implements ConfigurationPersister { @ Override public PersistenceResource store ( final ModelNode model , Set < PathAddress > affectedAddresses ) throws ConfigurationPersistenceException { } @ Override public void marshallAsXml ( ModelNode model , OutputStream output ) throws ConfigurationPersistenceException { } @ Override public List < ModelNode > load ( ) throws ConfigurationPersistenceException { } @ Override public void successfulBoot ( ) throws ConfigurationPersistenceException { } @ Override public String snapshot ( ) { } @ Override public SnapshotInfo listSnapshots ( ) { } @ Override public void deleteSnapshot ( String name ) { } } public ModelNode executeForResult ( ModelNode operation ) throws OperationFailedException { } }

Fix:
context . stepCompleted ( ) ;