incremental improvements to IT for mng-3599.

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@681249 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-07-31 01:07:50 +00:00
parent 41b9948451
commit 86555c0bd6
2 changed files with 13 additions and 6 deletions

View File

@ -68,19 +68,24 @@ public class MavenITmng3599useHttpProxyForWebDAV
throws Exception throws Exception
{ {
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3599-useHttpProxyForWebDAV" ); File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3599-useHttpProxyForWebDAV" );
String settings = FileUtils.fileRead( new File( testDir, "settings.xml.template" ) ); String settings = FileUtils.fileRead( new File( testDir, "settings.xml.template" ) );
settings = StringUtils.replace( settings, "@port@", Integer.toString( port ) ); settings = StringUtils.replace( settings, "@port@", Integer.toString( port ) );
String newSettings = StringUtils.replace( settings, "@protocol@", "http" ); String newSettings = StringUtils.replace( settings, "@protocol@", "http" );
FileUtils.fileWrite( new File( testDir, "settings.xml" ).getAbsolutePath(), newSettings ); FileUtils.fileWrite( new File( testDir, "settings.xml" ).getAbsolutePath(), newSettings );
Verifier verifier = new Verifier( testDir.getAbsolutePath() ); Verifier verifier = new Verifier( testDir.getAbsolutePath() );
List cliOptions = new ArrayList(); List cliOptions = new ArrayList();
cliOptions.add( "--settings" ); cliOptions.add( "--settings" );
cliOptions.add( "settings.xml" ); cliOptions.add( "settings.xml" );
verifier.setCliOptions( cliOptions ); verifier.setCliOptions( cliOptions );
verifier.deleteArtifact( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" ); verifier.deleteArtifact( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" );
verifier.deleteArtifact( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "pom" );
verifier.executeGoal( "compile" ); verifier.executeGoal( "compile" );
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.resetStreams(); verifier.resetStreams();
@ -101,9 +106,12 @@ public class MavenITmng3599useHttpProxyForWebDAV
if ( matchesVersionRange( "(2.0.10,2.0.99)" ) ) if ( matchesVersionRange( "(2.0.10,2.0.99)" ) )
{ {
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3599-useHttpProxyForWebDAV" ); File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3599-useHttpProxyForWebDAV" );
String settings = FileUtils.fileRead( new File( testDir, "settings.xml.template" ) ); String settings = FileUtils.fileRead( new File( testDir, "settings.xml.template" ) );
settings = StringUtils.replace( settings, "@port@", Integer.toString( port ) ); settings = StringUtils.replace( settings, "@port@", Integer.toString( port ) );
String newSettings = StringUtils.replace( settings, "@protocol@", "dav" );
FileUtils.fileWrite( new File( testDir, "settings.xml" ).getAbsolutePath(), newSettings );
Verifier verifier = new Verifier( testDir.getAbsolutePath() ); Verifier verifier = new Verifier( testDir.getAbsolutePath() );
@ -113,10 +121,9 @@ public class MavenITmng3599useHttpProxyForWebDAV
verifier.setCliOptions( cliOptions ); verifier.setCliOptions( cliOptions );
String newSettings = StringUtils.replace( settings, "@protocol@", "dav" );
FileUtils.fileWrite( new File( testDir, "settings.xml" ).getAbsolutePath(), newSettings );
verifier.deleteArtifact( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" ); verifier.deleteArtifact( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" );
verifier.deleteArtifact( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "pom" );
verifier.executeGoal( "compile" ); verifier.executeGoal( "compile" );
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier.resetStreams(); verifier.resetStreams();

View File

@ -10,7 +10,7 @@
<proxy> <proxy>
<id>http-proxy</id> <id>http-proxy</id>
<protocol>http</protocol> <protocol>http</protocol>
<host>localhost</host> <host>127.0.0.1</host>
<port>@port@</port> <port>@port@</port>
</proxy> </proxy>
</proxies> </proxies>