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 160f108d3e..7f4ced4b13 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 @@ -89,6 +89,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class ); + suite.addTestSuite( MavenITmng3873MultipleExecutionGoalsTest.class ); suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class ); suite.addTestSuite( MavenITmng3864PerExecPluginConfigTest.class ); suite.addTestSuite( MavenITmng3863AutoPluginGroupIdTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java new file mode 100644 index 0000000000..45db004435 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3873MultipleExecutionGoalsTest.java @@ -0,0 +1,90 @@ +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.List; + +/** + * This is a test set for MNG-3873. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng3873MultipleExecutionGoalsTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng3873MultipleExecutionGoalsTest() + { + } + + /** + * Test that all goals from a plugin execution are actually executed and not only one when no + * is involved. + */ + public void testitWithoutPluginManagement() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3873" ); + + Verifier verifier = new Verifier( new File( testDir, "test-1" ).getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + /* + * NOTE: We deliberately don't check the exact order here, that's another issue. + */ + List lines = verifier.loadLines( "target/it.log", "UTF-8" ); + assertTrue( lines.toString(), lines.contains( "test" ) ); + assertTrue( lines.toString(), lines.contains( "----" ) ); + } + + /** + * Test that all goals from a plugin execution are actually executed and not only one when + * is involved. + */ + public void testitWithPluginManagement() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3873" ); + + Verifier verifier = new Verifier( new File( testDir, "test-2" ).getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + /* + * NOTE: We deliberately don't check the exact order here, that's another issue. + */ + List lines = verifier.loadLines( "target/it.log", "UTF-8" ); + assertTrue( lines.toString(), lines.contains( "test" ) ); + assertTrue( lines.toString(), lines.contains( "----" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/bootstrap/pom.xml b/its/core-it-suite/src/test/resources/bootstrap/pom.xml index 6d49c767b9..049ff104f9 100644 --- a/its/core-it-suite/src/test/resources/bootstrap/pom.xml +++ b/its/core-it-suite/src/test/resources/bootstrap/pom.xml @@ -119,6 +119,12 @@ under the License. ${itPluginVersion} runtime + + org.apache.maven.its.plugins + maven-it-plugin-log-file + ${itPluginVersion} + runtime + org.apache.maven.its.plugins maven-it-plugin-no-project diff --git a/its/core-it-suite/src/test/resources/mng-3873/test-1/pom.xml b/its/core-it-suite/src/test/resources/mng-3873/test-1/pom.xml new file mode 100644 index 0000000000..6951be05bc --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3873/test-1/pom.xml @@ -0,0 +1,60 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3873 + test-1 + 0.1 + pom + + Maven Integration Test :: MNG-3873 + + Test that all goals from a plugin execution are actually executed and not only one. + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + test + validate + + log-separator + log-string + + + target/it.log + test + 4 + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-3873/test-2/pom.xml b/its/core-it-suite/src/test/resources/mng-3873/test-2/pom.xml new file mode 100644 index 0000000000..1e06f4dced --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3873/test-2/pom.xml @@ -0,0 +1,69 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3873 + test-2 + 0.1 + pom + + Maven Integration Test :: MNG-3873 + + Test that all goals from a plugin execution are actually executed and not only one. + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + test + validate + + log-separator + log-string + + + target/it.log + test + 4 + + + + + + +