mirror of https://github.com/apache/maven.git
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:
parent
5436f96a8f
commit
a5f8800c70
its/core-it-suite/src/test
java/org/apache/maven/it
resources
|
@ -52,7 +52,14 @@ public class MavenITmng0449PluginVersionResolutionTest
|
||||||
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setAutoclean( false );
|
verifier.setAutoclean( false );
|
||||||
verifier.deleteDirectory( "target" );
|
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" );
|
||||||
verifier.getCliOptions().add( "settings.xml" );
|
verifier.getCliOptions().add( "settings.xml" );
|
||||||
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
|
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 verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setAutoclean( false );
|
verifier.setAutoclean( false );
|
||||||
verifier.deleteDirectory( "target" );
|
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" );
|
||||||
verifier.getCliOptions().add( "settings.xml" );
|
verifier.getCliOptions().add( "settings.xml" );
|
||||||
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
|
verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
|
||||||
|
|
|
@ -114,15 +114,18 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
|
||||||
public void testitBasic()
|
public void testitBasic()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
testDir = new File( testDir, "test-1" );
|
||||||
|
|
||||||
Properties filterProps = new Properties();
|
Properties filterProps = new Properties();
|
||||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
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.setAutoclean( false );
|
||||||
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" );
|
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" );
|
||||||
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" );
|
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" );
|
||||||
verifier.filterFile( "settings-template.xml", "settings.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" );
|
||||||
verifier.getCliOptions().add( "settings.xml" );
|
verifier.getCliOptions().add( "settings.xml" );
|
||||||
verifier.executeGoal( "validate" );
|
verifier.executeGoal( "validate" );
|
||||||
|
@ -139,13 +142,15 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
|
||||||
public void testitRelocation()
|
public void testitRelocation()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
testDir = new File( testDir, "test-2" );
|
||||||
|
|
||||||
Properties filterProps = new Properties();
|
Properties filterProps = new Properties();
|
||||||
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
filterProps.setProperty( "@port@", Integer.toString( port ) );
|
||||||
// NOTE: The upper-case scheme name is essential part of the test
|
// 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 );
|
filterProps.setProperty( "@relocation@", secUrl );
|
||||||
|
|
||||||
Verifier verifier = new Verifier( new File( testDir, "test-2" ).getAbsolutePath() );
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setAutoclean( false );
|
verifier.setAutoclean( false );
|
||||||
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" );
|
verifier.deleteArtifacts( "org.apache.maven.its.mng0553" );
|
||||||
verifier.assertArtifactNotPresent( "org.apache.maven.its.mng0553", "a", "0.1-SNAPSHOT", "jar" );
|
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( "security-template.xml", "settings~security.xml", "UTF-8", filterProps );
|
||||||
verifier.filterFile( "settings-template.xml", "settings.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" );
|
||||||
verifier.getCliOptions().add( "settings.xml" );
|
verifier.getCliOptions().add( "settings.xml" );
|
||||||
// NOTE: The selection of the Turkish language for the JVM locale is essential part of the test
|
// 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()
|
public void testitEncryption()
|
||||||
throws Exception
|
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.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( "--encrypt-master-password" );
|
||||||
verifier.getCliOptions().add( "test" );
|
verifier.getCliOptions().add( "test" );
|
||||||
verifier.setLogFileName( "log-emp.txt" );
|
verifier.setLogFileName( "log-emp.txt" );
|
||||||
|
@ -184,9 +193,10 @@ public class MavenITmng0553SettingsAuthzEncryptionTest
|
||||||
List log = verifier.loadLines( verifier.getLogFileName(), null );
|
List log = verifier.loadLines( verifier.getLogFileName(), null );
|
||||||
assertNotNull( findPassword( log ) );
|
assertNotNull( findPassword( log ) );
|
||||||
|
|
||||||
verifier = new Verifier( new File( testDir, "test-3" ).getAbsolutePath() );
|
verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
verifier.setAutoclean( false );
|
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( "--encrypt-password" );
|
||||||
verifier.getCliOptions().add( "testpass" );
|
verifier.getCliOptions().add( "testpass" );
|
||||||
verifier.setLogFileName( "log-ep.txt" );
|
verifier.setLogFileName( "log-ep.txt" );
|
||||||
|
|
|
@ -37,7 +37,7 @@ under the License.
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>test</id>
|
<id>test</id>
|
||||||
<url>file:target/test-repo</url>
|
<url>file:///${basedir}/target/test-repo</url>
|
||||||
<layout>legacy</layout>
|
<layout>legacy</layout>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
|
@ -36,7 +36,7 @@ under the License.
|
||||||
<snapshotRepository>
|
<snapshotRepository>
|
||||||
<id>test</id>
|
<id>test</id>
|
||||||
<name>Test Repo</name>
|
<name>Test Repo</name>
|
||||||
<url>file:repo</url>
|
<url>file:///${basedir}/repo</url>
|
||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>maven-core-it</id>
|
<id>maven-core-it</id>
|
||||||
<url>file:///${basedir}/repo</url>
|
<url>file:///${basedir}/target/null</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue