From e3cbc52f0c7db9b4ab19785f7afa62722b4b80a5 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Mon, 29 Dec 2008 17:43:03 +0000 Subject: [PATCH] o Decoupled it0007 from production stuff git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@729957 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/it/MavenIT0007Test.java | 18 +++---- ...mng1021EqualAttachmentBuildNumberTest.java | 1 + .../src/test/resources/it0007/pom.xml | 48 ++++++++++++------- .../its/it0007/parent/2.0/parent-2.0.pom | 40 ++++++++++++++++ .../its/it0007/parent/maven-metadata.xml | 12 +++++ .../src/test/resources/it0007/settings.xml | 43 +++++++++++++++++ .../java/org/apache/maven/it0007/Person.java | 16 ------- .../src/main/resources/it0007.properties | 1 - .../org/apache/maven/it0007/PersonTest.java | 16 ------- 9 files changed, 137 insertions(+), 58 deletions(-) create mode 100644 its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/2.0/parent-2.0.pom create mode 100644 its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0007/settings.xml delete mode 100644 its/core-it-suite/src/test/resources/it0007/src/main/java/org/apache/maven/it0007/Person.java delete mode 100644 its/core-it-suite/src/test/resources/it0007/src/main/resources/it0007.properties delete mode 100644 its/core-it-suite/src/test/resources/it0007/src/test/java/org/apache/maven/it0007/PersonTest.java diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0007Test.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0007Test.java index 13e483178e..e8edb9ae33 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0007Test.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0007Test.java @@ -36,17 +36,17 @@ public class MavenIT0007Test throws Exception { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0007" ); + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.deleteArtifact( "org.apache.maven.plugins", "maven-plugin-parent", "2.0", "pom" ); - verifier.executeGoal( "package" ); - verifier.assertFilePresent( "target/classes/org/apache/maven/it0007/Person.class" ); - verifier.assertFilePresent( "target/test-classes/org/apache/maven/it0007/PersonTest.class" ); - verifier.assertFilePresent( "target/maven-it-it0007-1.0.jar" ); - verifier.assertFilePresent( "target/maven-it-it0007-1.0.jar!/it0007.properties" ); - verifier.assertArtifactPresent( "org.apache.maven.plugins", "maven-plugin-parent", "2.0", "pom" ); + verifier.setAutoclean( false ); + verifier.filterFile( "settings.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.deleteArtifacts( "org.apache.maven.its.it0007" ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( new File( testDir, "settings.xml" ).getAbsolutePath() ); + verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); - + verifier.assertArtifactPresent( "org.apache.maven.its.it0007", "parent", "2.0", "pom" ); } -} +} diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java index b10bbbcfad..bb3e4feada 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1021EqualAttachmentBuildNumberTest.java @@ -43,6 +43,7 @@ public class MavenITmng1021EqualAttachmentBuildNumberTest { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1021" ); Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); verifier.deleteDirectory( "repo" ); verifier.deleteArtifacts( "org.apache.maven.its.mng1021" ); verifier.executeGoal( "initialize" ); diff --git a/its/core-it-suite/src/test/resources/it0007/pom.xml b/its/core-it-suite/src/test/resources/it0007/pom.xml index 4a26c9d3f8..283c05b792 100644 --- a/its/core-it-suite/src/test/resources/it0007/pom.xml +++ b/its/core-it-suite/src/test/resources/it0007/pom.xml @@ -1,22 +1,38 @@ + + + + + 4.0.0 + - maven-plugin-parent - org.apache.maven.plugins + org.apache.maven.its.it0007 + parent 2.0 - 4.0.0 - maven-it-it0007 - We specify a parent in the POM and make sure that it is downloaded as - part of the process. - jar + + test 1.0 - - - junit - junit - 3.8.1 - jar - test - - + + Maven Integration Test :: it0007 + + Verify that a parent POM is successfully downloaded. + diff --git a/its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/2.0/parent-2.0.pom b/its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/2.0/parent-2.0.pom new file mode 100644 index 0000000000..e8d1d1158c --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/2.0/parent-2.0.pom @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0007 + parent + 2.0 + pom + + + + maven-core-it + file:///${basedir}/repo + + + + + true + + diff --git a/its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/maven-metadata.xml new file mode 100644 index 0000000000..610bc2d750 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0007/repo/org/apache/maven/its/it0007/parent/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.maven.its.it0007 + parent + 2.0 + + 2.0 + + 2.0 + + 20081229165708 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0007/settings.xml b/its/core-it-suite/src/test/resources/it0007/settings.xml new file mode 100644 index 0000000000..84f73bcadc --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0007/settings.xml @@ -0,0 +1,43 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/repo + + ignore + + + ignore + + + + + + + maven-core-it-repo + + diff --git a/its/core-it-suite/src/test/resources/it0007/src/main/java/org/apache/maven/it0007/Person.java b/its/core-it-suite/src/test/resources/it0007/src/main/java/org/apache/maven/it0007/Person.java deleted file mode 100644 index fd86c7e709..0000000000 --- a/its/core-it-suite/src/test/resources/it0007/src/main/java/org/apache/maven/it0007/Person.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.apache.maven.it0007; - -public class Person -{ - private String name; - - public void setName( String name ) - { - this.name = name; - } - - public String getName() - { - return name; - } -} diff --git a/its/core-it-suite/src/test/resources/it0007/src/main/resources/it0007.properties b/its/core-it-suite/src/test/resources/it0007/src/main/resources/it0007.properties deleted file mode 100644 index f54f8ab106..0000000000 --- a/its/core-it-suite/src/test/resources/it0007/src/main/resources/it0007.properties +++ /dev/null @@ -1 +0,0 @@ -name = jason diff --git a/its/core-it-suite/src/test/resources/it0007/src/test/java/org/apache/maven/it0007/PersonTest.java b/its/core-it-suite/src/test/resources/it0007/src/test/java/org/apache/maven/it0007/PersonTest.java deleted file mode 100644 index 228f5f0e96..0000000000 --- a/its/core-it-suite/src/test/resources/it0007/src/test/java/org/apache/maven/it0007/PersonTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.apache.maven.it0007; - -import junit.framework.TestCase; - -public class PersonTest - extends TestCase -{ - public void testPerson() - { - Person person = new Person(); - - person.setName( "foo" ); - - assertEquals( "foo", person.getName() ); - } -}