From 54977074bd8ee7422203b8fbbe3ce3fdcf00af60 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 10 Jan 2009 22:43:36 +0000 Subject: [PATCH] o Merged it0097 into the IT for the corresponding issue MNG-2068 git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@733392 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 - .../org/apache/maven/it/MavenIT0097Test.java | 55 ------------------ ...enITmng2068ReactorRelativeParentsTest.java | 51 +++++++++++------ .../src/test/resources/it0097/plugin/pom.xml | 14 ----- .../org/apache/maven/it0096/It0096Mojo.java | 56 ------------------- .../{it0097 => mng-2068/test-3}/pom.xml | 0 .../test-3}/project/pom.xml | 0 .../test-3}/project/project-level2/pom.xml | 0 .../project-level2/project-level3/pom.xml | 0 .../project/project-sibling-level2/pom.xml | 0 .../project/relative-project-level2/pom.xml | 0 .../relative-project-level3/pom.xml | 0 12 files changed, 35 insertions(+), 142 deletions(-) delete mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0097Test.java delete mode 100644 its/core-it-suite/src/test/resources/it0097/plugin/pom.xml delete mode 100644 its/core-it-suite/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/pom.xml (100%) rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/project/pom.xml (100%) rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/project/project-level2/pom.xml (100%) rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/project/project-level2/project-level3/pom.xml (100%) rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/project/project-sibling-level2/pom.xml (100%) rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/project/relative-project-level2/pom.xml (100%) rename its/core-it-suite/src/test/resources/{it0097 => mng-2068/test-3}/project/relative-project-level2/relative-project-level3/pom.xml (100%) diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 3ce55d200e..add56a6083 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -291,7 +291,6 @@ public class IntegrationTestSuite suite.addTestSuite( MavenIT0130CleanLifecycleTest.class ); suite.addTestSuite( MavenIT0115CustomArtifactHandlerAndCustomLifecycleTest.class ); suite.addTestSuite( MavenIT0113ServerAuthzAvailableToWagonMgrInPluginTest.class ); - suite.addTestSuite( MavenIT0097Test.class ); suite.addTestSuite( MavenIT0090Test.class ); suite.addTestSuite( MavenIT0087Test.class ); suite.addTestSuite( MavenIT0086Test.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0097Test.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0097Test.java deleted file mode 100644 index ce6a0744b6..0000000000 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0097Test.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.apache.maven.it; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.it.Verifier; -import org.apache.maven.it.util.ResourceExtractor; - -import java.io.File; - -/** - * This is a test set for MNG-2068. - * - * @author John Casey - * @version $Id$ - */ -public class MavenIT0097Test - extends AbstractMavenIntegrationTestCase -{ - - // TODO: There is another IT for this issue, check whether these are dups or could be merged - - /** - * Test that the implied relative path for the parent POM works, even two levels deep. - */ - public void testit0097() - throws Exception - { - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0097" ); - - Verifier verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.setAutoclean( false ); - verifier.deleteArtifacts( "org.apache.maven.its.mng2068" ); - verifier.executeGoal( "validate" ); - verifier.verifyErrorFreeLog(); - verifier.resetStreams(); - } - -} diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java index f8c0676ff2..33ae943fc9 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2068ReactorRelativeParentsTest.java @@ -49,22 +49,7 @@ public class MavenITmng2068ReactorRelativeParentsTest public void testitInheritedIdFields() throws Exception { - testitMNG2068( "test-1" ); - } - - /** - * Test successful lineage construction when parent specifies groupId+version itself. - */ - public void testitExplicitIdFields() - throws Exception - { - testitMNG2068( "test-2" ); - } - - private void testitMNG2068( String project ) - throws Exception - { - File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/" + project ); + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/test-1" ); File projectDir = new File( testDir, "parent" ); Verifier verifier = new Verifier( projectDir.getAbsolutePath() ); @@ -75,4 +60,38 @@ public class MavenITmng2068ReactorRelativeParentsTest verifier.resetStreams(); } + /** + * Test successful lineage construction when parent specifies groupId+version itself. + */ + public void testitExplicitIdFields() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/test-2" ); + File projectDir = new File( testDir, "parent" ); + + Verifier verifier = new Verifier( projectDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng2068" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + } + + /** + * Test that the implied relative path for the parent POM works, even two levels deep. + */ + public void testitComplex() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2068/test-3" ); + File projectDir = testDir; + + Verifier verifier = new Verifier( projectDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng2068" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + } + } diff --git a/its/core-it-suite/src/test/resources/it0097/plugin/pom.xml b/its/core-it-suite/src/test/resources/it0097/plugin/pom.xml deleted file mode 100644 index be9d38e47a..0000000000 --- a/its/core-it-suite/src/test/resources/it0097/plugin/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 4.0.0 - org.apache.maven.its.it0097 - 1 - maven-it0097-plugin - maven-plugin - - - org.apache.maven - maven-plugin-api - 2.0 - - - diff --git a/its/core-it-suite/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java b/its/core-it-suite/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java deleted file mode 100644 index b3b879edcc..0000000000 --- a/its/core-it-suite/src/test/resources/it0097/plugin/src/main/java/org/apache/maven/it0096/It0096Mojo.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apache.maven.it0096; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -/** - * @goal it0097 - */ -public class It0096Mojo extends AbstractMojo -{ - - /** - * @parameter default-value="${project.build.directory}" - * @required - * @readonly - */ - private File targetDirectory; - - public void execute() throws MojoExecutionException - { - targetDirectory.mkdirs(); - - File myFile = new File( targetDirectory, "it0097.txt" ); - - if ( myFile.exists() ) - { - throw new MojoExecutionException( "This mojo has already been run, or the project wasn't cleaned." ); - } - else - { - FileWriter writer = null; - try - { - writer = new FileWriter( myFile ); - writer.write( "test" ); - writer.close(); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Failed to write test file: " + myFile ); - } - finally - { - if ( writer != null ) - { - try{ writer.close(); } - catch( IOException e ) {} - } - } - } - } -} diff --git a/its/core-it-suite/src/test/resources/it0097/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/pom.xml diff --git a/its/core-it-suite/src/test/resources/it0097/project/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/project/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/project/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/project/pom.xml diff --git a/its/core-it-suite/src/test/resources/it0097/project/project-level2/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/project/project-level2/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/project/project-level2/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/project/project-level2/pom.xml diff --git a/its/core-it-suite/src/test/resources/it0097/project/project-level2/project-level3/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/project/project-level2/project-level3/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/project/project-level2/project-level3/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/project/project-level2/project-level3/pom.xml diff --git a/its/core-it-suite/src/test/resources/it0097/project/project-sibling-level2/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/project/project-sibling-level2/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/project/project-sibling-level2/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/project/project-sibling-level2/pom.xml diff --git a/its/core-it-suite/src/test/resources/it0097/project/relative-project-level2/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/project/relative-project-level2/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/project/relative-project-level2/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/project/relative-project-level2/pom.xml diff --git a/its/core-it-suite/src/test/resources/it0097/project/relative-project-level2/relative-project-level3/pom.xml b/its/core-it-suite/src/test/resources/mng-2068/test-3/project/relative-project-level2/relative-project-level3/pom.xml similarity index 100% rename from its/core-it-suite/src/test/resources/it0097/project/relative-project-level2/relative-project-level3/pom.xml rename to its/core-it-suite/src/test/resources/mng-2068/test-3/project/relative-project-level2/relative-project-level3/pom.xml