From 2d1e967e597ea94704c5149d5fbc7f35efe50618 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 23 Jan 2009 19:53:56 +0000 Subject: [PATCH] [MNG-4000] [regression] Plugin executions without id are lost when multiple executions are defined o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@737165 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...venITmng4000MultiPluginExecutionsTest.java | 86 +++++++++++++++++++ .../test/resources/mng-4000/test-1/pom.xml | 64 ++++++++++++++ .../test/resources/mng-4000/test-2/pom.xml | 72 ++++++++++++++++ 4 files changed, 223 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4000/test-1/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4000/test-2/pom.xml 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 3a5a51387e..770560d1d0 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 @@ -90,6 +90,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4000MultiPluginExecutionsTest.class ); suite.addTestSuite( MavenITmng3998PluginExecutionConfigTest.class ); suite.addTestSuite( MavenITmng3983PluginResolutionFromProfileReposTest.class ); suite.addTestSuite( MavenITmng3979ElementJoinTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java new file mode 100644 index 0000000000..e67e443747 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4000MultiPluginExecutionsTest.java @@ -0,0 +1,86 @@ +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; +import java.util.Arrays; +import java.util.List; + +/** + * This is a test set for MNG-4000. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng4000MultiPluginExecutionsTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4000MultiPluginExecutionsTest() + { + super(); + } + + /** + * Test that plugin executions without id are not lost among other plugin executions when no + * is present. + */ + public void testitWithoutPluginMngt() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4000/test-1" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List executions = verifier.loadLines( "target/exec.log", "UTF-8" ); + List expected = Arrays.asList( new String[] { "exec", "exec" } ); + assertEquals( expected, executions ); + } + + /** + * Test that plugin executions without id are not lost among other plugin executions when + * is present. + */ + public void testitWithPluginMngt() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4000/test-2" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List executions = verifier.loadLines( "target/exec.log", "UTF-8" ); + List expected = Arrays.asList( new String[] { "exec", "exec" } ); + assertEquals( expected, executions ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4000/test-1/pom.xml b/its/core-it-suite/src/test/resources/mng-4000/test-1/pom.xml new file mode 100644 index 0000000000..9fcf91b16d --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4000/test-1/pom.xml @@ -0,0 +1,64 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4000 + test1 + 0.1 + + Maven Integration Test :: MNG-4000 + + Test that plugin executions without id are not lost among other plugin executions. + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + target/exec.log + exec + + + + exec-1 + validate + + log-string + + + + + validate + + log-string + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4000/test-2/pom.xml b/its/core-it-suite/src/test/resources/mng-4000/test-2/pom.xml new file mode 100644 index 0000000000..4cbab22e5b --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4000/test-2/pom.xml @@ -0,0 +1,72 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4000 + test2 + 0.1 + + Maven Integration Test :: MNG-4000 + + Test that plugin executions without id are not lost among other plugin executions. + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + + target/exec.log + exec + + + + exec-1 + validate + + log-string + + + + + validate + + log-string + + + + + + +