Author: bentmann
Date: Tue Dec  2 09:53:03 2008
New Revision: 722543

URL: http://svn.apache.org/viewvc?rev=722543&view=rev
Log:
[MNG-3887] Order of plugin executions within same phase does not match POM 
order when plugin management is used

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml
   (with props)
Modified:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=722543&r1=722542&r2=722543&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
 (original)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
 Tue Dec  2 09:53:03 2008
@@ -88,6 +88,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- 
MNG-3137
 
+        suite.addTestSuite( MavenITmng3887PluginExecutionOrderTest.class );
         suite.addTestSuite( MavenITmng3886ExecutionGoalsOrderTest.class );
         suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class );
         suite.addTestSuite( MavenITmng3873MultipleExecutionGoalsTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java?rev=722543&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java
 Tue Dec  2 09:53:03 2008
@@ -0,0 +1,79 @@
+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 <a 
href="http://jira.codehaus.org/browse/MNG-3887";>MNG-3887</a>.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng3887PluginExecutionOrderTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng3887PluginExecutionOrderTest()
+    {
+    }
+
+    /**
+     * Test that multiple plugin executions bound to the same phase are 
executed in the order given by the POM when no
+     * <pluginManagement> is involved.
+     */
+    public void testitWithoutPluginManagement()
+        throws Exception
+    {
+        testitMNG3887( "test-1" );
+    }
+
+    /**
+     * Test that multiple plugin executions bound to the same phase are 
executed in the order given by the POM when
+     * <pluginManagement> is involved.
+     */
+    public void testitWithPluginManagement()
+        throws Exception
+    {
+        testitMNG3887( "test-2" );
+    }
+
+    private void testitMNG3887( String project )
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-3887" );
+
+        Verifier verifier = new Verifier( new File( testDir, project 
).getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        List lines = verifier.loadLines( "target/it.log", "UTF-8" );
+        assertEquals( Arrays.asList( new String[] { "test", "----" } ), lines 
);
+    }
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3887PluginExecutionOrderTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml?rev=722543&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml
 Tue Dec  2 09:53:03 2008
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng3887</groupId>
+  <artifactId>test-1</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-3887</name> 
+  <description>
+    Test that multiple plugin executions bound to the same phase are executed 
in the order given by the POM.
+  </description>
+
+  <build>
+    <!-- This project does not use plugin management for the test plugin -->
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-log-file</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <logFile>target/it.log</logFile>
+          <string>test</string>
+          <length>4</length>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test-1</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>log-separator</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-2</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>reset</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-3</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>log-string</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-4</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>log-separator</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-1/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml?rev=722543&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml
 Tue Dec  2 09:53:03 2008
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng3886</groupId>
+  <artifactId>test-2</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-3886</name> 
+  <description>
+    Test that multiple plugin executions bound to the same phase are executed 
in the order given by the POM.
+  </description>
+
+  <build>
+    <!-- This project uses plugin management for the test plugin -->
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.its.plugins</groupId>
+          <artifactId>maven-it-plugin-log-file</artifactId>
+          <version>2.1-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-log-file</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <logFile>target/it.log</logFile>
+          <string>test</string>
+          <length>4</length>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test-1</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>log-separator</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-2</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>reset</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-3</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>log-string</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-4</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>log-separator</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3887/test-2/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


Reply via email to