From 8cfd30e5438f5803e4ea7e1c612941a6d3c31842 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 17 May 2009 18:06:21 +0000 Subject: [PATCH] o Decoupled IT from production plugins git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@775727 13f79535-47bb-0310-9956-ffa450edef68 --- ...Tmng3106ProfileMultipleActivatorsTest.java | 4 +- .../it/MavenITmng3220ImportScopeTest.java | 38 ++++++++------ .../src/test/resources/mng-3106/pom.xml | 2 + .../dm-pom/pom.xml | 22 -------- .../depMgmt-pom-module-notImported/pom.xml | 51 +++++++++++++++---- .../project/pom.xml | 20 -------- .../project/src/main/java/test/App.java | 13 ----- .../project/src/test/java/test/AppTest.java | 38 -------------- .../imported-pom-depMgmt/dm-pom/pom.xml | 18 ------- .../mng-3220/imported-pom-depMgmt/parent.xml | 48 +++++++++++++++++ .../mng-3220/imported-pom-depMgmt/pom.xml | 51 +++++++++++++++++++ .../imported-pom-depMgmt/project/pom.xml | 28 ---------- .../project/src/main/java/test/App.java | 13 ----- .../project/src/test/java/test/AppTest.java | 38 -------------- .../maven/its/mng3220/dm-pom/1/dm-pom-1.pom | 47 +++++++++++++++++ .../its/mng3220/dm-pom/maven-metadata.xml | 13 +++++ .../resources/mng-3220/settings-template.xml | 43 ++++++++++++++++ 17 files changed, 270 insertions(+), 217 deletions(-) delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/dm-pom/pom.xml delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/pom.xml delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/main/java/test/App.java delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/test/java/test/AppTest.java delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/dm-pom/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/parent.xml create mode 100644 its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/pom.xml delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/pom.xml delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/main/java/test/App.java delete mode 100644 its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/test/java/test/AppTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/1/dm-pom-1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-3220/settings-template.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3106ProfileMultipleActivatorsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3106ProfileMultipleActivatorsTest.java index 537000287b..a70e958ab7 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3106ProfileMultipleActivatorsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3106ProfileMultipleActivatorsTest.java @@ -53,12 +53,14 @@ public class MavenITmng3106ProfileMultipleActivatorsTest Verifier verifier; verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); List cliOptions = new ArrayList(); cliOptions.add( "-Dprofile1.on=true" ); verifier.setCliOptions( cliOptions ); - verifier.executeGoal( "package" ); + verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.assertFilePresent( "target/profile1/touch.txt" ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java index 56295bd9ab..cad6f97600 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3220ImportScopeTest.java @@ -38,21 +38,18 @@ public class MavenITmng3220ImportScopeTest public void testitMNG3220a() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources( getClass(), - "/mng-3220/imported-pom-depMgmt" ); + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3220" ); - File dmDir = new File( testDir, "dm-pom" ); - Verifier verifier = new Verifier( dmDir.getAbsolutePath() ); + testDir = new File( testDir, "imported-pom-depMgmt" ); - verifier.executeGoal( "install" ); - - verifier.verifyErrorFreeLog(); - verifier.resetStreams(); - - File projectDir = new File( testDir, "project" ); - verifier = new Verifier( projectDir.getAbsolutePath() ); - - verifier.executeGoal( "package" ); + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng3220" ); + verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); } @@ -60,18 +57,27 @@ public class MavenITmng3220ImportScopeTest public void testitMNG3220b() throws Exception { - File testDir = ResourceExtractor.simpleExtractResources( getClass(), - "/mng-3220/depMgmt-pom-module-notImported" ); + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3220" ); + + testDir = new File( testDir, "depMgmt-pom-module-notImported" ); Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng3220" ); + verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings.xml" ); try { - verifier.executeGoal( "install" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); fail( "Should fail to build with missing junit version." ); } catch ( VerificationException e ) { + // expected } verifier.resetStreams(); diff --git a/its/core-it-suite/src/test/resources/mng-3106/pom.xml b/its/core-it-suite/src/test/resources/mng-3106/pom.xml index 7fe9e5a1de..20ace197b6 100644 --- a/its/core-it-suite/src/test/resources/mng-3106/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-3106/pom.xml @@ -32,6 +32,7 @@ profile1-touch + validate touch @@ -63,6 +64,7 @@ profile2-touch + validate touch diff --git a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/dm-pom/pom.xml b/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/dm-pom/pom.xml deleted file mode 100644 index a09ddd949f..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/dm-pom/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - 4.0.0 - - org.apache.maven.its.mng3220.2 - 1 - parent - - - dm-pom - pom - - - - - junit - junit - 3.8.1 - - - - diff --git a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/pom.xml b/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/pom.xml index 3b17387886..d5e026ceca 100644 --- a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/pom.xml @@ -1,24 +1,55 @@ + + + + 4.0.0 - org.apache.maven.its.mng3220.2 - parent - pom + + org.apache.maven.its.mng3220 + project 1 - - - dm-pom - project - - + jar + + Maven Integration Test :: MNG-3220 + + Verify that the dependency management from a dependency of type "pom" but without scope "import" does not + contribute to this project's dependency management. + + - org.apache.maven.its.mng3220.2 + org.apache.maven.its.mng3220 dm-pom 1 pom + + + + + junit + junit + + diff --git a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/pom.xml b/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/pom.xml deleted file mode 100644 index e150e35234..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - 4.0.0 - - org.apache.maven.its.mng3220.2 - 1 - parent - - - project - jar - - - - junit - junit - test - - - diff --git a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/main/java/test/App.java b/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/main/java/test/App.java deleted file mode 100644 index b8e9695d71..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/main/java/test/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package test; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/test/java/test/AppTest.java b/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/test/java/test/AppTest.java deleted file mode 100644 index e6046e53a6..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/depMgmt-pom-module-notImported/project/src/test/java/test/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package test; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/dm-pom/pom.xml b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/dm-pom/pom.xml deleted file mode 100644 index eb6ce83485..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/dm-pom/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - 4.0.0 - org.apache.maven.its.mng3220.1 - dm-pom - pom - 1 - - - - - junit - junit - 3.8.1 - - - - diff --git a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/parent.xml b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/parent.xml new file mode 100644 index 0000000000..119d191b3a --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/parent.xml @@ -0,0 +1,48 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3220 + parent + 1 + pom + + Maven Integration Test :: MNG-3220 + + Verify that the dependency management from a dependency of type "pom" and with scope "import" contributes to + this project's dependency management. + + + + + + org.apache.maven.its.mng3220 + dm-pom + 1 + pom + import + + + + diff --git a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/pom.xml b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/pom.xml new file mode 100644 index 0000000000..3881d07c22 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/pom.xml @@ -0,0 +1,51 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng3220 + parent + 1 + parent.xml + + + org.apache.maven.its.mng3220 + project + 1 + jar + + Maven Integration Test :: MNG-3220 + + Verify that the dependency management from a dependency of type "pom" and with scope "import" contributes to + this project's dependency management. + + + + + junit + junit + + + + diff --git a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/pom.xml b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/pom.xml deleted file mode 100644 index f7f3ce16f4..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - org.apache.maven.its.mng3220.1 - project - jar - 1 - - - - - org.apache.maven.its.mng3220.1 - dm-pom - 1 - pom - import - - - - - - - junit - junit - test - - - diff --git a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/main/java/test/App.java b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/main/java/test/App.java deleted file mode 100644 index b8e9695d71..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/main/java/test/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package test; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/test/java/test/AppTest.java b/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/test/java/test/AppTest.java deleted file mode 100644 index e6046e53a6..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3220/imported-pom-depMgmt/project/src/test/java/test/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package test; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/1/dm-pom-1.pom b/its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/1/dm-pom-1.pom new file mode 100644 index 0000000000..2fd36f96fc --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/1/dm-pom-1.pom @@ -0,0 +1,47 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3220 + dm-pom + 1 + pom + + + + + junit + junit + 3.8.2 + + + + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/maven-metadata.xml new file mode 100644 index 0000000000..8770e6a48b --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3220/repo/org/apache/maven/its/mng3220/dm-pom/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng3220 + dm-pom + 1 + + + 1 + + 20090517172816 + + diff --git a/its/core-it-suite/src/test/resources/mng-3220/settings-template.xml b/its/core-it-suite/src/test/resources/mng-3220/settings-template.xml new file mode 100644 index 0000000000..f22a7f3570 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3220/settings-template.xml @@ -0,0 +1,43 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/../repo + + ignore + + + false + + + + + + + maven-core-it-repo + +