mirror of https://github.com/apache/maven.git
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
6b3e0f817d
commit
2fd39c483d
|
@ -34,12 +34,10 @@ import java.util.Properties;
|
|||
public class MavenIT0146InstallerSnapshotNaming
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private Server server;
|
||||
|
||||
private int port;
|
||||
|
||||
|
||||
private final File testDir;
|
||||
|
||||
public MavenIT0146InstallerSnapshotNaming()
|
||||
|
@ -49,10 +47,10 @@ public class MavenIT0146InstallerSnapshotNaming
|
|||
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0146" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
|
||||
ResourceHandler resourceHandler = new ResourceHandler();
|
||||
resourceHandler.setResourceBase( new File( testDir, "repo" ).getAbsolutePath() );
|
||||
HandlerList handlers = new HandlerList();
|
||||
|
@ -61,28 +59,30 @@ public class MavenIT0146InstallerSnapshotNaming
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlers );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void testitRemoteDownloadTimestampedName()
|
||||
throws Exception
|
||||
{
|
||||
|
@ -109,14 +109,12 @@ public class MavenIT0146InstallerSnapshotNaming
|
|||
verifier.resetStreams();
|
||||
|
||||
verifier.assertFilePresent( "target/appassembler/repo/dep-0.1-20110726.105319-1.jar" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void testitNonTimestampedNameWithInstalledSNAPSHOT()
|
||||
throws Exception
|
||||
{
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.it0146" );
|
||||
verifier.addCliOption( "-f" );
|
||||
|
@ -150,6 +148,5 @@ public class MavenIT0146InstallerSnapshotNaming
|
|||
verifier.resetStreams();
|
||||
|
||||
verifier.assertFilePresent( "target/appassembler/repo/dep-0.1-SNAPSHOT.jar" );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -56,11 +55,10 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
|
|||
super( "[2.1.0,3.0-alpha-1),[3.0-alpha-3,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0553" );
|
||||
|
||||
Constraint constraint = new Constraint();
|
||||
|
@ -91,20 +89,27 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -232,5 +237,4 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
|
|||
verifier.setEnvironmentVariable( "MAVEN_OPTS", "\"-Duser.home=" + path + "\"" );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -30,7 +29,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -67,7 +65,7 @@ public class MavenITmng0768OfflineModeTest
|
|||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -101,11 +99,22 @@ public class MavenITmng0768OfflineModeTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
|
||||
{
|
||||
// phase 1: run build in online mode to fill local repo
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
|
@ -172,7 +181,7 @@ public class MavenITmng0768OfflineModeTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -75,12 +74,23 @@ public class MavenITmng2305MultipleProxiesTest
|
|||
server.addConnector( newHttpsConnector( storePath, storePwd, keyPwd ) );
|
||||
server.setHandler( new RepoHandler() );
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int httpPort = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to HTTP port " + httpPort );
|
||||
int httpsPort = server.getConnectors()[1].getLocalPort();
|
||||
System.out.println( "Bound server socket to HTTPS port " + httpsPort );
|
||||
|
||||
TunnelingProxyServer proxy = new TunnelingProxyServer( 0, "localhost", httpsPort, "https.mngit:443" );
|
||||
proxy.start();
|
||||
int proxyPort = proxy.getPort();
|
||||
System.out.println( "Bound server socket to the proxy port " + proxyPort );
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -159,7 +169,5 @@ public class MavenITmng2305MultipleProxiesTest
|
|||
|
||||
( (Request) request ).setHandled( true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,8 @@ public class MavenITmng2387InactiveProxyTest
|
|||
super( "[2.0.11,2.1.0-M1),[2.1.0,)" ); // 2.0.11+, 2.1.0+
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2387" );
|
||||
|
@ -68,8 +69,16 @@ public class MavenITmng2387InactiveProxyTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlers );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the HTTP port " + port );
|
||||
|
||||
resourceHandler = new ResourceHandler();
|
||||
resourceHandler.setResourceBase( new File( testDir, "proxy" ).getAbsolutePath() );
|
||||
|
@ -80,24 +89,31 @@ public class MavenITmng2387InactiveProxyTest
|
|||
proxyServer = new Server( 0 );
|
||||
proxyServer.setHandler( handlers );
|
||||
proxyServer.start();
|
||||
|
||||
while ( !proxyServer.isRunning() || !proxyServer.isStarted() )
|
||||
{
|
||||
if ( proxyServer.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
proxyPort = proxyServer.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the HTTPS port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
if ( proxyServer != null )
|
||||
{
|
||||
proxyServer.stop();
|
||||
proxyServer = null;
|
||||
proxyServer.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,5 +141,4 @@ public class MavenITmng2387InactiveProxyTest
|
|||
|
||||
verifier.assertArtifactPresent( "org.apache.maven.its.mng2387", "a", "0.1", "jar" );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,9 +30,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Deque;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-3415">MNG-3415</a>.
|
||||
|
@ -158,7 +158,7 @@ public class MavenITmng3415JunkRepositoryMetadataTest
|
|||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng3415" );
|
||||
|
||||
final List<String> requestUris = new ArrayList<>();
|
||||
final Deque<String> requestUris = new ConcurrentLinkedDeque<>();
|
||||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
|
@ -176,11 +176,21 @@ public class MavenITmng3415JunkRepositoryMetadataTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.put( "@protocol@", "http" );
|
||||
|
@ -225,11 +235,11 @@ public class MavenITmng3415JunkRepositoryMetadataTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
private void assertMetadataMissing( Verifier verifier )
|
||||
throws IOException
|
||||
{
|
||||
File metadata = getMetadataFile( verifier );
|
||||
|
||||
|
@ -238,7 +248,7 @@ public class MavenITmng3415JunkRepositoryMetadataTest
|
|||
}
|
||||
|
||||
private void setupDummyDependency( Verifier verifier, File testDir, boolean resetUpdateInterval )
|
||||
throws VerificationException, IOException
|
||||
throws IOException
|
||||
{
|
||||
String gid = "org.apache.maven.its.mng3415";
|
||||
String aid = "missing";
|
||||
|
@ -258,7 +268,6 @@ public class MavenITmng3415JunkRepositoryMetadataTest
|
|||
}
|
||||
|
||||
private File getMetadataFile( Verifier verifier )
|
||||
throws IOException
|
||||
{
|
||||
String gid = "org.apache.maven.its.mng3415";
|
||||
String aid = "missing";
|
||||
|
@ -291,5 +300,4 @@ public class MavenITmng3415JunkRepositoryMetadataTest
|
|||
|
||||
return new File( verifier.getArtifactMetadataPath( gid, aid, version, name ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,14 +19,12 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -87,7 +85,7 @@ public class MavenITmng3461MirrorMatchingTest
|
|||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -117,11 +115,21 @@ public class MavenITmng3461MirrorMatchingTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng3461" );
|
||||
|
@ -137,6 +145,7 @@ public class MavenITmng3461MirrorMatchingTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
verifier.assertArtifactPresent( "org.apache.maven.its.mng3461", "a", "0.1", "jar" );
|
||||
|
@ -166,5 +175,4 @@ public class MavenITmng3461MirrorMatchingTest
|
|||
|
||||
verifier.assertArtifactPresent( "org.apache.maven.its.mng3461", "a", "0.1", "jar" );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.apache.maven.it;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
@ -62,13 +61,14 @@ public class MavenITmng3599useHttpProxyForWebDAVMk2Test
|
|||
super( "[3.3.9,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
Handler handler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Got request for URL: '" + request.getRequestURL() + "'" );
|
||||
System.out.flush();
|
||||
|
@ -113,19 +113,26 @@ public class MavenITmng3599useHttpProxyForWebDAVMk2Test
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handler );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.apache.maven.it;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -64,13 +63,14 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
|
|||
super( "(2.0.9,3.3.9)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
Handler handler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Got request for URL: '" + request.getRequestURL() + "'" );
|
||||
System.out.flush();
|
||||
|
@ -115,19 +115,26 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handler );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,9 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.mortbay.jetty.Handler;
|
||||
import org.mortbay.jetty.Request;
|
||||
|
@ -55,13 +53,14 @@ public class MavenITmng3652UserAgentHeaderTest
|
|||
super( "[2.1.0-M1,3.0-alpha-1),[3.0-beta-3,)" ); // 2.1.0-M1+
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
Handler handler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Handling URL: '" + request.getRequestURL() + "'" );
|
||||
|
||||
|
@ -83,19 +82,26 @@ public class MavenITmng3652UserAgentHeaderTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handler );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
if ( server != null)
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,10 +141,10 @@ public class MavenITmng3652UserAgentHeaderTest
|
|||
// NOTE: system property for maven.version may not exist if you use -Dtest
|
||||
// surefire parameter to run this single test. Therefore, the plugin writes
|
||||
// the maven version into the check file.
|
||||
String mavenVersion = getMavenUAVersion( (String) lines.get( 0 ) );
|
||||
String javaVersion = (String) lines.get( 1 );
|
||||
String os = (String) lines.get( 2 ) + " " + (String) lines.get( 3 );
|
||||
String artifactVersion = (String) lines.get( 4 );
|
||||
String mavenVersion = getMavenUAVersion( lines.get( 0 ) );
|
||||
String javaVersion = lines.get( 1 );
|
||||
String os = lines.get( 2 ) + " " + lines.get( 3 );
|
||||
String artifactVersion = lines.get( 4 );
|
||||
|
||||
if ( matchesVersionRange( "(,3.0-beta-3)" ) )
|
||||
{
|
||||
|
@ -184,10 +190,10 @@ public class MavenITmng3652UserAgentHeaderTest
|
|||
// NOTE: system property for maven.version may not exist if you use -Dtest
|
||||
// surefire parameter to run this single test. Therefore, the plugin writes
|
||||
// the maven version into the check file.
|
||||
String mavenVersion = getMavenUAVersion( (String) lines.get( 0 ) );
|
||||
String javaVersion = (String) lines.get( 1 );
|
||||
String os = (String) lines.get( 2 ) + " " + (String) lines.get( 3 );
|
||||
String artifactVersion = (String) lines.get( 4 );
|
||||
String mavenVersion = getMavenUAVersion( lines.get( 0 ) );
|
||||
String javaVersion = lines.get( 1 );
|
||||
String os = lines.get( 2 ) + " " + lines.get( 3 );
|
||||
String artifactVersion = lines.get( 4 );
|
||||
|
||||
String userAgent = this.userAgent;
|
||||
assertNotNull( userAgent );
|
||||
|
@ -238,10 +244,10 @@ public class MavenITmng3652UserAgentHeaderTest
|
|||
// NOTE: system property for maven.version may not exist if you use -Dtest
|
||||
// surefire parameter to run this single test. Therefore, the plugin writes
|
||||
// the maven version into the check file.
|
||||
String mavenVersion = getMavenUAVersion( (String) lines.get( 0 ) );
|
||||
String javaVersion = (String) lines.get( 1 );
|
||||
String os = (String) lines.get( 2 ) + " " + (String) lines.get( 3 );
|
||||
String artifactVersion = (String) lines.get( 4 );
|
||||
String mavenVersion = getMavenUAVersion( lines.get( 0 ) );
|
||||
String javaVersion = lines.get( 1 );
|
||||
String os = lines.get( 2 ) + " " + lines.get( 3 );
|
||||
String artifactVersion = lines.get( 4 );
|
||||
|
||||
String userAgent = this.userAgent;
|
||||
assertNotNull( userAgent );
|
||||
|
|
|
@ -20,13 +20,10 @@ package org.apache.maven.it;
|
|||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.mortbay.jetty.Handler;
|
||||
import org.mortbay.jetty.Request;
|
||||
|
@ -47,7 +44,6 @@ import org.mortbay.jetty.security.SecurityHandler;
|
|||
public class MavenITmng3953AuthenticatedDeploymentTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private Server server;
|
||||
|
||||
private int port;
|
||||
|
@ -59,15 +55,13 @@ public class MavenITmng3953AuthenticatedDeploymentTest
|
|||
super( "(2.0.1,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -109,22 +103,28 @@ public class MavenITmng3953AuthenticatedDeploymentTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
deployed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.apache.maven.it;
|
|||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.handler.DefaultHandler;
|
||||
|
@ -54,7 +53,8 @@ public class MavenITmng4068AuthenticatedMirrorTest
|
|||
super( ALL_MAVEN_VERSIONS );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
@ -89,20 +89,27 @@ public class MavenITmng4068AuthenticatedMirrorTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,25 +54,23 @@ import java.util.Properties;
|
|||
public class MavenITmng4235HttpAuthDeploymentChecksumsTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private File testDir;
|
||||
|
||||
private Server server;
|
||||
|
||||
private int port;
|
||||
|
||||
RepoHandler repoHandler = new RepoHandler();
|
||||
private final RepoHandler repoHandler = new RepoHandler();
|
||||
|
||||
public MavenITmng4235HttpAuthDeploymentChecksumsTest()
|
||||
{
|
||||
super( "[2.0.5,2.2.0),(2.2.0,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4235" );
|
||||
|
||||
repoHandler.setResourceBase( testDir.getAbsolutePath() );
|
||||
|
@ -102,20 +100,27 @@ public class MavenITmng4235HttpAuthDeploymentChecksumsTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -165,7 +170,7 @@ public class MavenITmng4235HttpAuthDeploymentChecksumsTest
|
|||
{
|
||||
String actualHash = ItUtils.calcHash( new File( verifier.getBasedir(), dataFile ), algo );
|
||||
|
||||
String expectedHash = verifier.loadLines( dataFile + hashExt, "UTF-8" ).get( 0 ).toString().trim();
|
||||
String expectedHash = verifier.loadLines( dataFile + hashExt, "UTF-8" ).get( 0 ).trim();
|
||||
|
||||
assertTrue( "expected=" + expectedHash + ", actual=" + actualHash,
|
||||
expectedHash.equalsIgnoreCase( actualHash ) );
|
||||
|
|
|
@ -25,16 +25,16 @@ import org.mortbay.jetty.Request;
|
|||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.handler.AbstractHandler;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4326">MNG-4326</a>.
|
||||
|
@ -68,12 +68,12 @@ public class MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest
|
|||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
final List<String> uris = new ArrayList<>();
|
||||
final Deque<String> uris = new ConcurrentLinkedDeque<>();
|
||||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
PrintWriter writer = response.getWriter();
|
||||
|
||||
|
@ -131,15 +131,25 @@ public class MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
// test 1: resolve snapshot, just built local copy should suppress daily remote update check
|
||||
verifier = newVerifier( new File( testDir, "test" ).getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "--settings" );
|
||||
verifier.addCliOption( "settings.xml" );
|
||||
|
@ -175,5 +185,4 @@ public class MavenITmng4326LocalSnapshotSuppressesRemoteCheckTest
|
|||
server.stop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,26 +19,27 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Deque;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.hamcrest.CoreMatchers;
|
||||
import org.mortbay.jetty.Handler;
|
||||
import org.mortbay.jetty.Request;
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.handler.AbstractHandler;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4343">MNG-4343</a>.
|
||||
*
|
||||
|
@ -48,25 +49,27 @@ import org.mortbay.jetty.handler.AbstractHandler;
|
|||
public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private Server server;
|
||||
|
||||
private List<String> requestedUris;
|
||||
private Deque<String> requestedUris;
|
||||
|
||||
private volatile boolean blockAccess;
|
||||
|
||||
private int port;
|
||||
|
||||
public MavenITmng4343MissingReleaseUpdatePolicyTest()
|
||||
{
|
||||
super( "[3.0-alpha-3,)" );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -111,19 +114,28 @@ public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
|
||||
requestedUris = Collections.synchronizedList( new ArrayList<String>() );
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
requestedUris = new ConcurrentLinkedDeque<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
requestedUris = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,7 +155,7 @@ public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
|||
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@updates@", "always" );
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
|
||||
blockAccess = true;
|
||||
|
@ -195,7 +207,7 @@ public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
|||
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@updates@", "never" );
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
|
||||
blockAccess = true;
|
||||
|
@ -230,7 +242,8 @@ public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
|||
// expected
|
||||
}
|
||||
|
||||
assertEquals( new ArrayList<String>(), requestedUris );
|
||||
//noinspection unchecked
|
||||
assertThat( requestedUris, CoreMatchers.<String>hasItems() );
|
||||
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng4343", "dep", "0.1", "jar" );
|
||||
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng4343", "dep", "0.1", "pom" );
|
||||
|
||||
|
@ -239,8 +252,8 @@ public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
|||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
|
||||
assertTrue( requestedUris.toString(), requestedUris.contains( "/dep/0.1/dep-0.1.jar" ) );
|
||||
assertTrue( requestedUris.toString(), requestedUris.contains( "/dep/0.1/dep-0.1.pom" ) );
|
||||
assertThat( requestedUris, hasItem( "/dep/0.1/dep-0.1.jar" ) );
|
||||
assertThat( requestedUris, hasItem( "/dep/0.1/dep-0.1.pom" ) );
|
||||
verifier.assertArtifactPresent( "org.apache.maven.its.mng4343", "dep", "0.1", "jar" );
|
||||
verifier.assertArtifactPresent( "org.apache.maven.its.mng4343", "dep", "0.1", "pom" );
|
||||
|
||||
|
@ -251,7 +264,8 @@ public class MavenITmng4343MissingReleaseUpdatePolicyTest
|
|||
verifier.executeGoal( "validate" );
|
||||
verifier.verifyErrorFreeLog();
|
||||
|
||||
assertEquals( new ArrayList<String>(), requestedUris );
|
||||
//noinspection unchecked
|
||||
assertThat( requestedUris, CoreMatchers.<String>hasItems() );
|
||||
|
||||
verifier.resetStreams();
|
||||
}
|
||||
|
|
|
@ -19,17 +19,14 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -69,7 +66,6 @@ public class MavenITmng4348NoUnnecessaryRepositoryAccessTest
|
|||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -87,12 +83,20 @@ public class MavenITmng4348NoUnnecessaryRepositoryAccessTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4348" );
|
||||
verifier.deleteDirectory( "target" );
|
||||
|
@ -108,10 +112,10 @@ public class MavenITmng4348NoUnnecessaryRepositoryAccessTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
verifier.assertFilePresent( "target/touch.txt" );
|
||||
assertEquals( new ArrayList<String>(), requestedUris );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -28,7 +27,6 @@ import java.io.PrintWriter;
|
|||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -84,7 +82,7 @@ public class MavenITmng4360WebDavSupportTest
|
|||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
throws IOException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -116,12 +114,20 @@ public class MavenITmng4360WebDavSupportTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( repoHandler );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4360" );
|
||||
verifier.deleteDirectory( "target" );
|
||||
|
@ -137,10 +143,10 @@ public class MavenITmng4360WebDavSupportTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
List<String> cp = verifier.loadLines( "target/classpath.txt", "UTF-8" );
|
||||
assertTrue( cp.toString(), cp.contains( "dep-0.1.jar" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -84,16 +83,26 @@ public class MavenITmng4413MirroringOfDependencyRepoTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4413" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
verifier.addCliOption( "settings.xml" );
|
||||
|
@ -106,7 +115,7 @@ public class MavenITmng4413MirroringOfDependencyRepoTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -129,10 +128,18 @@ public class MavenITmng4428FollowHttpRedirectTest
|
|||
Connector from = server.getConnectors()[ fromHttp ? 0 : 1 ];
|
||||
Connector to = server.getConnectors()[ toHttp ? 0 : 1 ];
|
||||
server.setHandler( new RedirectHandler( toHttp ? "http" : "https", relativeLocation ? null : to ) );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
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.setAutoclean( false );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4428" );
|
||||
verifier.deleteDirectory( "target" );
|
||||
|
@ -152,6 +159,7 @@ public class MavenITmng4428FollowHttpRedirectTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
List<String> cp = verifier.loadLines( "target/classpath.txt", "UTF-8" );
|
||||
|
@ -175,7 +183,7 @@ public class MavenITmng4428FollowHttpRedirectTest
|
|||
|
||||
private final Connector connector;
|
||||
|
||||
public RedirectHandler( String protocol, Connector connector )
|
||||
RedirectHandler( String protocol, Connector connector )
|
||||
{
|
||||
this.protocol = protocol;
|
||||
this.connector = connector;
|
||||
|
|
|
@ -20,13 +20,10 @@ package org.apache.maven.it;
|
|||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.mortbay.jetty.Handler;
|
||||
import org.mortbay.jetty.Request;
|
||||
|
@ -47,7 +44,6 @@ import org.mortbay.jetty.security.SecurityHandler;
|
|||
public class MavenITmng4469AuthenticatedDeploymentToCustomRepoTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private Server server;
|
||||
|
||||
private int port;
|
||||
|
@ -59,15 +55,13 @@ public class MavenITmng4469AuthenticatedDeploymentToCustomRepoTest
|
|||
super( "[2.0.3,3.0-alpha-3),[3.0-alpha-6,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -109,22 +103,28 @@ public class MavenITmng4469AuthenticatedDeploymentToCustomRepoTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
deployed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,5 +151,4 @@ public class MavenITmng4469AuthenticatedDeploymentToCustomRepoTest
|
|||
|
||||
assertTrue( deployed );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,14 +33,12 @@ import org.mortbay.jetty.security.ConstraintMapping;
|
|||
import org.mortbay.jetty.security.HashUserRealm;
|
||||
import org.mortbay.jetty.security.SecurityHandler;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Deque;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4470">MNG-4470</a>.
|
||||
|
@ -51,29 +49,26 @@ import java.util.List;
|
|||
public class MavenITmng4470AuthenticatedDeploymentToProxyTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private Server server;
|
||||
|
||||
private int port;
|
||||
|
||||
private volatile boolean deployed;
|
||||
|
||||
List<DeployedResource> deployedResources = new ArrayList<>();
|
||||
private final Deque<DeployedResource> deployedResources = new ConcurrentLinkedDeque<>();
|
||||
|
||||
public MavenITmng4470AuthenticatedDeploymentToProxyTest()
|
||||
{
|
||||
super( "[2.0.3,3.0-alpha-1),[3.0-alpha-6,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
Handler proxyHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -105,9 +100,7 @@ public class MavenITmng4470AuthenticatedDeploymentToProxyTest
|
|||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -159,22 +152,28 @@ public class MavenITmng4470AuthenticatedDeploymentToProxyTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
deployed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,9 +197,6 @@ public class MavenITmng4470AuthenticatedDeploymentToProxyTest
|
|||
private void testit( String project )
|
||||
throws Exception
|
||||
{
|
||||
|
||||
deployedResources = new ArrayList<>();
|
||||
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4470/" + project );
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
|
@ -224,5 +220,4 @@ public class MavenITmng4470AuthenticatedDeploymentToProxyTest
|
|||
|
||||
assertTrue( deployed );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -84,16 +83,26 @@ public class MavenITmng4489MirroringOfExtensionRepoTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4489" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
verifier.addCliOption( "settings.xml" );
|
||||
|
@ -107,7 +116,7 @@ public class MavenITmng4489MirroringOfExtensionRepoTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,17 +19,14 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -70,7 +67,6 @@ public class MavenITmng4500NoUpdateOfTimestampedSnapshotsTest
|
|||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
requestedUris.add( request.getRequestURI() );
|
||||
}
|
||||
|
@ -86,16 +82,26 @@ public class MavenITmng4500NoUpdateOfTimestampedSnapshotsTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4500" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
verifier.addCliOption( "settings.xml" );
|
||||
|
@ -124,7 +130,7 @@ public class MavenITmng4500NoUpdateOfTimestampedSnapshotsTest
|
|||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,13 +26,11 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.apache.maven.shared.utils.io.FileUtils;
|
||||
import org.mortbay.jetty.Connector;
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.handler.AbstractHandler;
|
||||
import org.mortbay.jetty.handler.DefaultHandler;
|
||||
|
@ -69,7 +67,6 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
requestedUris.add( request.getRequestURI() );
|
||||
}
|
||||
|
@ -85,21 +82,19 @@ 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
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
try
|
||||
|
@ -112,7 +107,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( connector.getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@repo@", "repo-1" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
|
@ -157,7 +152,6 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
requestedUris.add( request.getRequestURI() );
|
||||
}
|
||||
|
@ -173,21 +167,19 @@ 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
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
try
|
||||
|
@ -200,7 +192,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( connector.getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@repo@", "repo-1" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-U" );
|
||||
|
@ -248,7 +240,6 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
requestedUris.add( request.getRequestURI() );
|
||||
}
|
||||
|
@ -264,21 +255,19 @@ 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
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
try
|
||||
|
@ -291,7 +280,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( connector.getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@repo@", "repo-it" );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
|
@ -324,5 +313,4 @@ public class MavenITmng4554PluginPrefixMappingUpdateTest
|
|||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,10 +28,9 @@ import org.mortbay.jetty.handler.AbstractHandler;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Deque;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4555">MNG-4555</a>.
|
||||
|
@ -55,12 +54,11 @@ public class MavenITmng4555MetaversionResolutionOfflineTest
|
|||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4555" );
|
||||
|
||||
final List<String> uris = new ArrayList<>();
|
||||
final Deque<String> uris = new ConcurrentLinkedDeque<>();
|
||||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException
|
||||
{
|
||||
String uri = request.getRequestURI();
|
||||
|
||||
|
@ -84,8 +82,18 @@ public class MavenITmng4555MetaversionResolutionOfflineTest
|
|||
verifier.deleteArtifacts( "org.apache.maven.its.mng4555" );
|
||||
try
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "--offline" );
|
||||
verifier.addCliOption( "--settings" );
|
||||
|
@ -100,9 +108,9 @@ public class MavenITmng4555MetaversionResolutionOfflineTest
|
|||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
assertTrue( uris.toString(), uris.isEmpty() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -86,14 +85,24 @@ public class MavenITmng4561MirroringOfPluginRepoTest
|
|||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4561" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
verifier.addCliOption( "settings.xml" );
|
||||
|
@ -108,7 +117,7 @@ public class MavenITmng4561MirroringOfPluginRepoTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -86,14 +85,24 @@ public class MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest
|
|||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4729" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-s" );
|
||||
verifier.addCliOption( "settings.xml" );
|
||||
|
@ -107,7 +116,7 @@ public class MavenITmng4729MirrorProxyAuthUsedByProjectBuilderTest
|
|||
finally
|
||||
{
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,17 +19,13 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Deque;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -61,12 +57,11 @@ public class MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest
|
|||
{
|
||||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4771" );
|
||||
|
||||
final List<String> requestedUris = Collections.synchronizedList( new ArrayList<String>() );
|
||||
final Deque<String> requestedUris = new ConcurrentLinkedDeque<>();
|
||||
|
||||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
requestedUris.add( request.getRequestURI() );
|
||||
}
|
||||
|
@ -83,10 +78,20 @@ public class MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest
|
|||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-U" );
|
||||
verifier.addCliOption( "-s" );
|
||||
|
@ -97,15 +102,15 @@ public class MavenITmng4771PluginPrefixResolutionDoesntTouchDisabledRepoTest
|
|||
}
|
||||
catch ( VerificationException e )
|
||||
{
|
||||
assertTrue( true );
|
||||
// expected
|
||||
}
|
||||
finally
|
||||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
assertTrue( requestedUris.toString(), requestedUris.isEmpty() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,17 +19,14 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -66,7 +63,6 @@ public class MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest
|
|||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
requestedUris.add( request.getRequestURI() );
|
||||
}
|
||||
|
@ -83,10 +79,20 @@ public class MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest
|
|||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-U" );
|
||||
verifier.addCliOption( "-s" );
|
||||
|
@ -97,15 +103,15 @@ public class MavenITmng4772PluginVersionResolutionDoesntTouchDisabledRepoTest
|
|||
}
|
||||
catch ( VerificationException e )
|
||||
{
|
||||
assertTrue( true );
|
||||
// expected
|
||||
}
|
||||
finally
|
||||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
|
||||
assertTrue( requestedUris.toString(), requestedUris.isEmpty() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,16 +20,12 @@ package org.apache.maven.it;
|
|||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Deque;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
import org.mortbay.jetty.Handler;
|
||||
import org.mortbay.jetty.Request;
|
||||
|
@ -37,6 +33,9 @@ import org.mortbay.jetty.Server;
|
|||
import org.mortbay.jetty.handler.AbstractHandler;
|
||||
import org.mortbay.jetty.handler.HandlerList;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4781">MNG-4781</a>.
|
||||
*
|
||||
|
@ -45,14 +44,13 @@ import org.mortbay.jetty.handler.HandlerList;
|
|||
public class MavenITmng4781DeploymentToNexusStagingRepoTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private Server server;
|
||||
|
||||
private int port;
|
||||
|
||||
private List<String> requestedUris = Collections.synchronizedList( new ArrayList<String>() );
|
||||
private final Deque<String> requestedUris = new ConcurrentLinkedDeque<>();
|
||||
|
||||
private List<String> deployedUris = Collections.synchronizedList( new ArrayList<String>() );
|
||||
private final Deque<String> deployedUris = new ConcurrentLinkedDeque<>();
|
||||
|
||||
public MavenITmng4781DeploymentToNexusStagingRepoTest()
|
||||
{
|
||||
|
@ -62,15 +60,11 @@ public class MavenITmng4781DeploymentToNexusStagingRepoTest
|
|||
public void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
Handler repoHandler = new AbstractHandler()
|
||||
{
|
||||
|
||||
private boolean putSeen;
|
||||
private volatile boolean putSeen;
|
||||
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
|
||||
|
||||
|
@ -100,8 +94,16 @@ public class MavenITmng4781DeploymentToNexusStagingRepoTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handlerList );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
protected void tearDown()
|
||||
|
@ -110,13 +112,11 @@ public class MavenITmng4781DeploymentToNexusStagingRepoTest
|
|||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
requestedUris.clear();
|
||||
deployedUris.clear();
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,15 +137,9 @@ public class MavenITmng4781DeploymentToNexusStagingRepoTest
|
|||
verifier.verifyErrorFreeLog();
|
||||
verifier.resetStreams();
|
||||
|
||||
assertTrue( deployedUris.toString(),
|
||||
deployedUris.contains( "/repo/org/apache/maven/its/mng4781/release/1.0/release-1.0.jar" ) );
|
||||
assertTrue( deployedUris.toString(),
|
||||
deployedUris.contains( "/repo/org/apache/maven/its/mng4781/release/1.0/release-1.0.pom" ) );
|
||||
assertTrue( deployedUris.toString(),
|
||||
deployedUris.contains( "/repo/org/apache/maven/its/mng4781/release/maven-metadata.xml" ) );
|
||||
|
||||
assertTrue( requestedUris.toString(),
|
||||
deployedUris.contains( "/repo/org/apache/maven/its/mng4781/release/maven-metadata.xml" ) );
|
||||
assertThat( deployedUris, hasItem( "/repo/org/apache/maven/its/mng4781/release/1.0/release-1.0.jar" ) );
|
||||
assertThat( deployedUris, hasItem( "/repo/org/apache/maven/its/mng4781/release/1.0/release-1.0.pom" ) );
|
||||
assertThat( deployedUris, hasItem( "/repo/org/apache/maven/its/mng4781/release/maven-metadata.xml" ) );
|
||||
assertThat( requestedUris, hasItem( "/repo/org/apache/maven/its/mng4781/release/maven-metadata.xml" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,20 +19,18 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.InetAddress;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.mortbay.jetty.Handler;
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.handler.DefaultHandler;
|
||||
import org.mortbay.jetty.handler.HandlerList;
|
||||
import org.mortbay.jetty.handler.ResourceHandler;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.InetAddress;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4991">MNG-4991</a>.
|
||||
*
|
||||
|
@ -63,7 +61,6 @@ public class MavenITmng4991NonProxyHostsTest
|
|||
|
||||
Server server = new Server( 0 );
|
||||
server.setHandler( handlers );
|
||||
server.start();
|
||||
|
||||
/*
|
||||
* NOTE: To guard against automatic fallback to direct connection when the proxy is unreachable, we set up
|
||||
|
@ -71,11 +68,30 @@ public class MavenITmng4991NonProxyHostsTest
|
|||
*/
|
||||
Server proxy = new Server( 0 );
|
||||
proxy.setHandler( new DefaultHandler() );
|
||||
proxy.start();
|
||||
|
||||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
server.start();
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
proxy.start();
|
||||
while ( !proxy.isRunning() || !proxy.isStarted() )
|
||||
{
|
||||
if ( proxy.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng4991" );
|
||||
|
@ -94,11 +110,12 @@ public class MavenITmng4991NonProxyHostsTest
|
|||
verifier.resetStreams();
|
||||
server.stop();
|
||||
proxy.stop();
|
||||
server.join();
|
||||
proxy.join();
|
||||
}
|
||||
|
||||
List<String> compile = verifier.loadLines( "target/compile.txt", "UTF-8" );
|
||||
|
||||
assertTrue( compile.toString(), compile.contains( "dep-0.1.jar" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,17 +19,14 @@ package org.apache.maven.it;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.ResourceExtractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -69,7 +66,6 @@ public class MavenITmng5064SuppressSnapshotUpdatesTest
|
|||
AbstractHandler logHandler = new AbstractHandler()
|
||||
{
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException, ServletException
|
||||
{
|
||||
if ( request.getRequestURI().startsWith( "/repo/" ) )
|
||||
{
|
||||
|
@ -93,11 +89,21 @@ public class MavenITmng5064SuppressSnapshotUpdatesTest
|
|||
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||
try
|
||||
{
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
int port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
verifier.setAutoclean( false );
|
||||
verifier.deleteDirectory( "target" );
|
||||
verifier.deleteArtifacts( "org.apache.maven.its.mng5064" );
|
||||
Properties filterProps = verifier.newDefaultFilterProperties();
|
||||
filterProps.setProperty( "@port@", Integer.toString( server.getConnectors()[0].getLocalPort() ) );
|
||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
|
||||
verifier.addCliOption( "-nsu" );
|
||||
verifier.addCliOption( "-s" );
|
||||
|
@ -125,7 +131,7 @@ public class MavenITmng5064SuppressSnapshotUpdatesTest
|
|||
{
|
||||
verifier.resetStreams();
|
||||
server.stop();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ public class MavenITmng5175WagonHttpTest
|
|||
super( "[3.0.4,)" ); // 3.0.4+
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
Handler handler = new AbstractHandler()
|
||||
|
@ -78,19 +79,26 @@ public class MavenITmng5175WagonHttpTest
|
|||
server = new Server( 0 );
|
||||
server.setHandler( handler );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
port = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + port );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,9 +126,5 @@ public class MavenITmng5175WagonHttpTest
|
|||
|
||||
verifier.verifyTextInLog( "Read timed out" );
|
||||
verifier.resetStreams();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -43,41 +43,46 @@ import org.mortbay.jetty.handler.AbstractHandler;
|
|||
public class MavenITmng5280SettingsProfilesRepositoriesOrderTest
|
||||
extends AbstractMavenIntegrationTestCase
|
||||
{
|
||||
|
||||
private File testDir;
|
||||
|
||||
private Server server;
|
||||
|
||||
int httpPort;
|
||||
private int httpPort;
|
||||
|
||||
public MavenITmng5280SettingsProfilesRepositoriesOrderTest()
|
||||
{
|
||||
super( "[3.1-A,)" );
|
||||
}
|
||||
|
||||
public void setUp()
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5280" );
|
||||
|
||||
server = new Server( 0 );
|
||||
server.start();
|
||||
|
||||
while ( !server.isRunning() || !server.isStarted() )
|
||||
{
|
||||
if ( server.isFailed() )
|
||||
{
|
||||
fail( "Couldn't bind the server socket to a free port!" );
|
||||
}
|
||||
Thread.sleep( 100L );
|
||||
}
|
||||
httpPort = server.getConnectors()[0].getLocalPort();
|
||||
System.out.println( "Bound server socket to the port " + httpPort );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
if ( server != null )
|
||||
{
|
||||
server.stop();
|
||||
server = null;
|
||||
server.join();
|
||||
}
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,12 +138,12 @@ public class MavenITmng5280SettingsProfilesRepositoriesOrderTest
|
|||
assertTrue( pluginRepoHandler.pluginRequestedFromRepo1Last );
|
||||
}
|
||||
|
||||
private class RepoHandler
|
||||
private static final class RepoHandler
|
||||
extends AbstractHandler
|
||||
{
|
||||
boolean artifactRequestedFromRepo1Last = false;
|
||||
private volatile boolean artifactRequestedFromRepo1Last;
|
||||
|
||||
boolean artifactRequestedFromRepo2 = false;
|
||||
private volatile boolean artifactRequestedFromRepo2;
|
||||
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException
|
||||
|
@ -193,9 +198,9 @@ public class MavenITmng5280SettingsProfilesRepositoriesOrderTest
|
|||
private class PluginRepoHandler
|
||||
extends AbstractHandler
|
||||
{
|
||||
boolean pluginRequestedFromRepo1Last = false;
|
||||
private volatile boolean pluginRequestedFromRepo1Last;
|
||||
|
||||
boolean pluginRequestedFromRepo2 = false;
|
||||
private volatile boolean pluginRequestedFromRepo2;
|
||||
|
||||
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
|
||||
throws IOException
|
||||
|
|
Loading…
Reference in New Issue