o Prepared ITs for execution by embedded Maven

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@823585 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-10-09 15:23:19 +00:00
parent 5436f96a8f
commit a5f8800c70
5 changed files with 38 additions and 14 deletions

View File

@ -52,7 +52,14 @@ public class MavenITmng0449PluginVersionResolutionTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng0449" );
try
{
verifier.deleteArtifacts( "org.apache.maven.its.mng0449" );
}
catch ( Exception e )
{
// when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them
}
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
@ -87,7 +94,14 @@ public class MavenITmng0449PluginVersionResolutionTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng0449" );
try
{
verifier.deleteArtifacts( "org.apache.maven.its.mng0449" );
}
catch ( Exception e )
{
// when we run Maven embedded, the plugin class realm locks the artifacts so we can't delete them
}
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );

View File

@ -114,15 +114,18 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
public void testitBasic()
throws Exception
{
testDir = new File( testDir, "test-1" );
Properties filterProps = new Properties();
filterProps.setProperty( "@port@", Integer.toString( port ) );
Verifier verifier = new Verifier( new File( testDir, "test-1" ).getAbsolutePath() );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" );
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
verifier.getSystemProperties().setProperty( "settings.security", "settings-security.xml" );
verifier.getSystemProperties().setProperty( "settings.security",
new File( testDir, "settings-security.xml" ).getAbsolutePath() );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
@ -139,13 +142,15 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
public void testitRelocation()
throws Exception
{
testDir = new File( testDir, "test-2" );
Properties filterProps = new Properties();
filterProps.setProperty( "@port@", Integer.toString( port ) );
// NOTE: The upper-case scheme name is essential part of the test
String secUrl = "FILE://" + new File( testDir, "test-2/relocated-settings-security.xml" ).toURI().getRawPath();
String secUrl = "FILE://" + new File( testDir, "relocated-settings-security.xml" ).toURI().getRawPath();
filterProps.setProperty( "@relocation@", secUrl );
Verifier verifier = new Verifier( new File( testDir, "test-2" ).getAbsolutePath() );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" );
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" );
@ -154,7 +159,8 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
verifier.filterFile( "security-template.xml", "settings~security.xml", "UTF-8", filterProps );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
verifier.getSystemProperties().setProperty( "settings.security", "settings~security.xml" );
verifier.getSystemProperties().setProperty( "settings.security",
new File( testDir, "settings~security.xml" ).getAbsolutePath() );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
// NOTE: The selection of the Turkish language for the JVM locale is essential part of the test
@ -171,9 +177,12 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
public void testitEncryption()
throws Exception
{
Verifier verifier = new Verifier( new File( testDir, "test-3" ).getAbsolutePath() );
testDir = new File( testDir, "test-3" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.getSystemProperties().setProperty( "settings.security", "settings~security.xml" );
verifier.getSystemProperties().setProperty( "settings.security",
new File( testDir, "settings-security.xml" ).getAbsolutePath() );
verifier.getCliOptions().add( "--encrypt-master-password" );
verifier.getCliOptions().add( "test" );
verifier.setLogFileName( "log-emp.txt" );
@ -184,9 +193,10 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
List log = verifier.loadLines( verifier.getLogFileName(), null );
assertNotNull( findPassword( log ) );
verifier = new Verifier( new File( testDir, "test-3" ).getAbsolutePath() );
verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.getSystemProperties().setProperty( "settings.security", "settings-security.xml" );
verifier.getSystemProperties().setProperty( "settings.security",
new File( testDir, "settings-security.xml" ).getAbsolutePath() );
verifier.getCliOptions().add( "--encrypt-password" );
verifier.getCliOptions().add( "testpass" );
verifier.setLogFileName( "log-ep.txt" );

View File

@ -37,7 +37,7 @@ under the License.
<distributionManagement>
<repository>
<id>test</id>
<url>file:target/test-repo</url>
<url>file:///${basedir}/target/test-repo</url>
<layout>legacy</layout>
</repository>
</distributionManagement>

View File

@ -36,7 +36,7 @@ under the License.
<snapshotRepository>
<id>test</id>
<name>Test Repo</name>
<url>file:repo</url>
<url>file:///${basedir}/repo</url>
</snapshotRepository>
</distributionManagement>

View File

@ -7,7 +7,7 @@
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
<url>file:///${basedir}/target/null</url>
</repository>
</distributionManagement>