mirror of https://github.com/apache/maven.git
fixed the IT 4554 as LocalPort is -1 if Jetty connector is not open. Error message in logs: [WARNING] Could not transfer metadata org.apache.maven.its.mng4554/maven-metadata.xml from/to central (http://localhost:-1/repo-1): Connect to localhost:80 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
This commit is contained in:
parent
5721184d5e
commit
6b3e0f817d
|
@ -85,7 +85,17 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
Connector connector = server.getConnectors()[0];
|
||||
connector.setHost( "localhost" );
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
|
@ -102,7 +112,7 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
assertFalse( new File( verifier.getArtifactMetadataPath( "org.apache.maven.its.mng4554", null, null, "maven-metadata-mng4554.xml" ) ).exists() );
|
||||
}
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( connector.getLocalPort() ) );
|
||||
filterProps.setProperty( "@repo@", "repo-1" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
|
@ -127,6 +137,7 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,7 +173,17 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
Connector connector = server.getConnectors()[0];
|
||||
connector.setHost( "localhost" );
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
|
@ -179,7 +200,7 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
assertFalse( new File( verifier.getArtifactMetadataPath( "org.apache.maven.its.mng4554", null, null, "maven-metadata-mng4554.xml" ) ).exists() );
|
||||
}
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( connector.getLocalPort() ) );
|
||||
filterProps.setProperty( "@repo@", "repo-1" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-U" );
|
||||
|
@ -205,6 +226,7 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue