Buggy code:
public class JmxAuditLogHandlerTestCase extends AbstractControllerTestBase { volatile PathManagerService pathManagerService ; volatile ManagedAuditLogger auditLogger ; volatile File logDir ; volatile MBeanServer server ; private static final String ANY_PLACEHOLDER = "$$$<seq2seq4repair_space>ANY<seq2seq4repair_space>$$$<seq2seq4repair_space>ANY<seq2seq4repair_space>$$$" ; private static final ObjectName OBJECT_NAME ; private final List < ModelNode > bootOperations = new ArrayList < ModelNode > ( ) ; public JmxAuditLogHandlerTestCase ( ) { } @ BeforeClass public static void setPlatformMBeanServer ( ) { } @ Before public void installMBeans ( ) throws Exception { } @ After public void clearDependencies ( ) throws Exception { } protected ManagedAuditLogger getAuditLogger ( ) { } @ Test public void testAuditLoggerBootUp ( ) throws Exception { } @ Test public void testAuditLoggerAddAndRemoveJmxReference ( ) throws Exception { } @ Test public void testSameFileCoreAndJmxAuditLog ( ) throws Exception { } @ Test public void testSeparateFileCoreAndJmxAuditLog ( ) throws Exception { } @ Test public void testDisableAndEnableAuditLog ( ) throws Exception { } @ Test public void testToggleReadOnly ( ) throws Exception { } private void checkOpsEqual ( ModelNode rawDmr , ModelNode fromLog ) { } private final Pattern DATE_STAMP_PATTERN = Pattern . compile ( "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]<seq2seq4repair_space>[0-9][0-9]:[0-9][0-9]:[0-9][0-9]<seq2seq4repair_space>-<seq2seq4repair_space>\\{" ) ; private List < ModelNode > readFile ( File file , int expectedRecords ) throws IOException { } private ModelNode createAddFileHandlerOperation ( String handlerName , String formatterName , String fileName ) { } private PathAddress createFileHandlerAddress ( String handlerName ) { } private ModelNode createAddCoreHandlerReferenceOperation ( String name ) { } private ModelNode createRemoveCoreHandlerReferenceOperation ( String name ) { } private PathAddress createCoreHandlerReferenceAddress ( String name ) { } private ModelNode createAddJmxHandlerReferenceOperation ( String name ) { } private ModelNode createRemoveJmxHandlerReferenceOperation ( String name ) { } private PathAddress createJmxHandlerReferenceAddress ( String name ) { } private ModelNode createCoreAuditLogWriteAttributeOperation ( String attr , boolean value ) { } private ModelNode createJMXAuditLogWriteAttributeOperation ( String attr , boolean value ) { } private List < ModelNode > checkCoreBootRecordHeader ( ModelNode bootRecord , int ops , boolean readOnly , boolean booting , boolean success ) { } private void checkJmxBootRecordHeader ( ModelNode bootRecord , boolean readOnly , String [ ] sig , String [ ] args ) { } @ Override protected void addBootOperations ( List < ModelNode > bootOperations ) { } protected void initModel ( Resource rootResource , ManagementResourceRegistration registration ) { if ( ( logDir ) == null ) { logDir = new File ( "." ) ; logDir = new File ( logDir , "target" ) ; logDir = new File ( logDir , "audit-log-test-log-dir" ) . getAbsoluteFile ( ) ; if ( ! ( logDir . exists ( ) ) ) { logDir . mkdirs ( ) ; } } for ( File file : logDir . listFiles ( ) ) { file . delete ( ) ; } pathManagerService = new PathManagerService ( ) { } ; GlobalOperationHandlers . registerGlobalOperations ( registration , processType ) ; registration . registerOperationHandler ( DEFINITION , INSTANCE ) ; JmxAuditLogHandlerTestCase . TestServiceListener listener = new JmxAuditLogHandlerTestCase . TestServiceListener ( ) ; listener . reset ( 1 ) ; getContainer ( ) . addService ( SERVICE_NAME , pathManagerService ) . addListener ( listener ) . install ( ) ; try { listener . latch . await ( 10 , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new RuntimeException ( e ) ; } registration . registerSubModel ( PathResourceDefinition . createSpecified ( pathManagerService ) ) ; registration . registerSubModel ( CoreManagementResourceDefinition . forStandaloneServer ( new DelegatingConfigurableAuthorizer ( ) , getAuditLogger ( ) , pathManagerService , new EnvironmentNameReader ( ) { public boolean isServer ( ) { return true ; } public String getServerName ( ) { return "Test" ; } public String getHostName ( ) { return null ; } public String getProductName ( ) { return null ; } } ) ) ; pathManagerService . addPathManagerResources ( rootResource ) ; <START_BUG> ExtensionRegistry extensionRegistry = new ExtensionRegistry ( ProcessType . STANDALONE_SERVER , new org . jboss . as . controller . RunningModeControl ( RunningMode . NORMAL ) , auditLogger ) ; <END_BUG> extensionRegistry . setWriterRegistry ( new NullConfigurationPersister ( ) ) ; extensionRegistry . setSubsystemParentResourceRegistrations ( registration , null ) ; JMXExtension extension = new JMXExtension ( ) ; extension . initialize ( extensionRegistry . getExtensionContext ( "xxxx" , false ) ) ; rootResource . registerChild ( PATH_ELEMENT , Factory . create ( ) ) ; } private class TestServiceListener extends AbstractServiceListener < Object > { volatile CountDownLatch latch ; Map < ServiceController . Transition , ServiceName > services = Collections . synchronizedMap ( new LinkedHashMap < ServiceController . Transition , ServiceName > ( ) ) ; void reset ( int count ) { } public void transition ( ServiceController < ? extends Object > controller , ServiceController . Transition transition ) { } } private interface BeanMBean { int getAttr ( ) { } void setAttr ( int i ) { } } private static class Bean implements JmxAuditLogHandlerTestCase . BeanMBean { volatile int attr ; @ Override public int getAttr ( ) { } @ Override public void setAttr ( int i ) { } } }

Fix:
ExtensionRegistry extensionRegistry = new ExtensionRegistry ( ProcessType . STANDALONE_SERVER , new org . jboss . as . controller . RunningModeControl ( RunningMode . NORMAL ) , auditLogger , null ) ;