Buggy code:
private static final String TYPE_STANDALONE = "STANDALONE" ; private static final String TYPE_DOMAIN = "DOMAIN" ; private static final ObjectName ROOT_NAME = Constants . ROOT_MODEL_NAME ; private static final ObjectName INTERFACE_NAME = ModelControllerMBeanTestCase . createObjectName ( ( ( Constants . DOMAIN ) + ":interface=test-interface" ) ) ; private static final ObjectName SOCKET_BINDING_GROUP_NAME = ModelControllerMBeanTestCase . createObjectName ( ( ( Constants . DOMAIN ) + ":socket-binding-group=test-socket-binding-group" ) ) ; private static final ObjectName SERVER_SOCKET_BINDING_NAME = ModelControllerMBeanTestCase . createObjectName ( ( ( Constants . DOMAIN ) + ":socket-binding-group=test-socket-binding-group,socket-binding=server" ) ) ; private static final ObjectName SERVER_SOCKET_BINDING_NAME_2 = ModelControllerMBeanTestCase . createObjectName ( ( ( Constants . DOMAIN ) + ":socket-binding=server,socket-binding-group=test-socket-binding-group" ) ) ; private static final ObjectName SUBSYSTEM_NAME = ModelControllerMBeanTestCase . createObjectName ( ( ( Constants . DOMAIN ) + ":subsystem=jmx" ) ) ; private static final ObjectName BAD_NAME = ModelControllerMBeanTestCase . createObjectName ( ( ( Constants . DOMAIN ) + ":type=bad" ) ) ; public ModelControllerMBeanTestCase ( ) { } @ Test public void testExposedMBeans ( ) throws Exception { } @ Test public void testGetObjectInstance ( ) throws Exception { } @ Test public void testGetMBeanInfoStandalone ( ) throws Exception { } @ Test public void testGetMBeanInfoDomain ( ) throws Exception { } private void checkMBeanInfoAttributes ( MBeanInfo info , boolean writable ) { } @ Test public void testReadWriteAttributeStandalone ( ) throws Exception { } @ Test public void testReadWriteAttributeDomain ( ) throws Exception { } private void checkAttributeValues ( MBeanServerConnection connection , ObjectName name , int roInt , Integer undefinedInt , int i , BigInteger bigInt , BigDecimal bigDecimal , boolean bool , byte [ ] bytes , double dbl , String s , List < Integer > list , long lng , ModelType type , String tblKey1 , int tblValue1 , String tblKey2 , int tblValue2 ) throws Exception { } @ Test public void testReadWriteAttributeListStandalone ( ) throws Exception { } @ Test public void testReadWriteAttributeListDomain ( ) throws Exception { } private void checkAttributeList ( String [ ] attrNames , AttributeList list , int roInt , int i , BigInteger bi , BigDecimal bd , boolean b , byte [ ] bytes , double d , String s , List < Integer > lst , long l , ModelType type ) { } @ Test public void testInvokeOperationStandalone ( ) throws Exception { } @ Test public void testInvokeOperationDomain ( ) throws Exception { } @ Test public void testAddMethodSingleFixedChild ( ) throws Exception { } @ Test public void testAddMethodSiblingChildren ( ) throws Exception { } private OpenMBeanOperationInfo findOperation ( MBeanOperationInfo [ ] ops , String name ) { } private OpenMBeanAttributeInfo findAttribute ( MBeanAttributeInfo [ ] attrs , String name ) { } private void assertEqualByteArray ( byte [ ] bytes , int ... expected ) { } private void assertEqualByteArray ( byte [ ] bytes , byte ... expected ) { } private void assertEqualList ( List < ? > list , Object ... expected ) { } private CompositeData createComplexData ( MBeanServerConnection connection , CompositeType type , int intValue , BigDecimal bigDecimalValue ) throws Exception { } private void assertMapType ( OpenType < ? > mapType , OpenType < ? > keyType , OpenType < ? > valueType ) { } private void checkComplexTypeInfo ( CompositeType composite ) { } private void assertAttributeDescription ( MBeanAttributeInfo attribute , String name , String type , String description , boolean readable , boolean writable ) { } private OpenType < ? > assertCompositeType ( CompositeType composite , String name , String type , String description ) { } private OpenType < ? > assertCompositeType ( CompositeType composite , String name , String type , String description , boolean validateType ) { } private static < T > T assertGetFromList ( Class < T > clazz , AttributeList list , String name ) { } private static < T > T assertCast ( Class < T > clazz , Object value ) { } private void checkSameMBeans ( Set < ObjectInstance > instances , Set < ObjectName > objectNames ) { } private void assertContainsNames ( Set < ObjectName > objectNames , ObjectName ... expected ) { } private MBeanServerConnection setupAndGetConnection ( ModelControllerMBeanTestCase . BaseAdditionalInitialization additionalInitialization ) throws Exception { String subsystemXml = ( ( ( ( ( "<subsystem<seq2seq4repair_space>xmlns=\"" + ( CURRENT . getUriString ( ) ) ) + "\">" ) + "<show-model<seq2seq4repair_space>value=\"true\"//>" ) + "<remoting-connector//>" ) + "<//subsystem>" ) + ( additionalInitialization . getExtraXml ( ) ) ; KernelServices services = super . installInController ( additionalInitialization , subsystemXml ) ; String host = "localhost" ; int port = 12345 ; <START_BUG> String urlString = System . getProperty ( "jmx.service.url" , ( ( ( "service:jmx:remote:////" + host ) + ":" ) + port ) ) ; <END_BUG> JMXServiceURL serviceURL = new JMXServiceURL ( urlString ) ; long end = ( System . currentTimeMillis ( ) ) + 10000 ; while ( true ) { try { JMXConnector jmxConnector = JMXConnectorFactory . connect ( serviceURL , null ) ; return jmxConnector . getMBeanServerConnection ( ) ; } catch ( Exception e ) { if ( ( System . currentTimeMillis ( ) ) >= end ) { throw new RuntimeException ( e ) ; } Thread . sleep ( 50 ) ; } } } private static ObjectName createObjectName ( String s ) { } private static class BaseAdditionalInitialization extends AdditionalInitialization { final String launchType ; public BaseAdditionalInitialization ( String launchType ) { } @ Override protected void initializeExtraSubystemsAndModel ( ExtensionRegistry extensionRegistry , Resource rootResource , ManagementResourceRegistration rootRegistration ) { } @ Override protected void setupController ( ControllerInitializer controllerInitializer ) { } @ Override protected void addExtraServices ( final ServiceTarget target ) { } String getExtraXml ( ) { } } private static class MBeanInfoAdditionalInitialization extends ModelControllerMBeanTestCase . BaseAdditionalInitialization { private final Extension extension ; public MBeanInfoAdditionalInitialization ( String launchType , Extension extension ) { } @ Override protected void addParsers ( ExtensionRegistry extensionRegistry , XMLMapper xmlMapper ) { }

Fix:
String urlString = System . getProperty ( "jmx.service.url" , ( ( ( "service:jmx:remoting-jmx:////" + host ) + ":" ) + port ) ) ;