Author: bentmann
Date: Thu Aug 27 15:11:07 2009
New Revision: 808450

URL: http://svn.apache.org/viewvc?rev=808450&view=rev
Log:
[MNG-4327] [regression] Forking mojos that are bound to a lifecycle phase that 
gets forked execute multiple times

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4327/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4327/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=808450&r1=808449&r2=808450&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
 Thu Aug 27 15:11:07 2009
@@ -86,6 +86,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- 
MNG-3137
 
+        suite.addTestSuite( 
MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.class );
         suite.addTestSuite( MavenITmng4321CliUsesPluginMgmtConfigTest.class );
         suite.addTestSuite( MavenITmng4320AggregatorAndDependenciesTest.class 
);
         suite.addTestSuite( MavenITmng4318ProjectExecutionRootTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java?rev=808450&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest.java
 Thu Aug 27 15:11:07 2009
@@ -0,0 +1,63 @@
+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 <a 
href="http://jira.codehaus.org/browse/MNG-4327";>MNG-4327</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4327ExcludeForkingMojoFromForkedLifecycleTest()
+    {
+        super( ALL_MAVEN_VERSIONS );
+    }
+
+    /**
+     * Verify that lifecycle forking mojos are excluded from the lifecycles 
that have directly or indirectly forked
+     * by them.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-4327" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "generate-sources" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        List log = verifier.loadLines( "target/fork-lifecycle.txt", "UTF-8" );
+        assertEquals( 1, log.size() );
+        assertTrue( log.toString(), log.contains( "fork-lifecycle.txt" ) );
+    }
+
+}

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

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

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4327/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4327/pom.xml?rev=808450&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4327/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4327/pom.xml
 Thu Aug 27 15:11:07 2009
@@ -0,0 +1,58 @@
+<?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.mng4327</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4327</name>
+  <description>
+    Verify that lifecycle forking mojos are excluded from the lifecycles that 
have directly or indirectly forked
+    by them.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-fork</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>fork</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <!--
+              This forks the lifecycle up to the phase "generate-sources" and 
hence encounters this execution again
+              which should then be excluded from the forked lifecycle.
+              -->
+              <goal>fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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


Reply via email to