You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/07/08 18:02:59 UTC

svn commit: r792202 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-2576/ resources/mng-2576/sub-a/ resources/mng-2576/sub-b/ resources/mng-2576/sub-c/ resources/mng-2576/sub-d/

Author: bentmann
Date: Wed Jul  8 16:02:58 2009
New Revision: 792202

URL: http://svn.apache.org/viewvc?rev=792202&view=rev
Log:
[MNG-2576] Make Like Reactor Mode

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-a/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-a/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-b/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-b/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-c/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-c/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-d/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-d/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=792202&r1=792201&r2=792202&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 Wed Jul  8 16:02:58 2009
@@ -277,6 +277,7 @@
         suite.addTestSuite( MavenITmng2668UsePluginDependenciesForSortingTest.class );
         suite.addTestSuite( MavenITmng2605BogusProfileActivationTest.class );
         suite.addTestSuite( MavenITmng2591MergeInheritedPluginConfigTest.class );
+        suite.addTestSuite( MavenITmng2576MakeLikeReactorTest.class );
         suite.addTestSuite( MavenITmng2562TimestampTest.class );
         suite.addTestSuite( MavenITmng2539PluginDependenciesComeFromPluginReposTest.class );
         suite.addTestSuite( MavenITmng2432PluginPrefixOrderTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java?rev=792202&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2576MakeLikeReactorTest.java Wed Jul  8 16:02:58 2009
@@ -0,0 +1,161 @@
+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 java.io.File;
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4193">MNG-4193</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng2576MakeLikeReactorTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng2576MakeLikeReactorTest()
+    {
+        super( "[2.1.0,)" ); 
+    }
+
+    /**
+     * Verify that project list by itself only builds specified projects.
+     */
+    public void testitOnlyList()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2576" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteDirectory( "sub-a/target" );
+        verifier.deleteDirectory( "sub-b/target" );
+        verifier.deleteDirectory( "sub-c/target" );
+        verifier.deleteDirectory( "sub-d/target" );
+        verifier.getCliOptions().add( "-pl" );
+        verifier.getCliOptions().add( "sub-b" );
+        verifier.setLogFileName( "log-only.txt" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFileNotPresent( "target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-a/target/touch.txt" );
+        verifier.assertFilePresent( "sub-b/target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-c/target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-d/target/touch.txt" );
+    }
+
+    /**
+     * Verify that project list and all their upstream projects are built.
+     */
+    public void testitMakeUpstream()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2576" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteDirectory( "sub-a/target" );
+        verifier.deleteDirectory( "sub-b/target" );
+        verifier.deleteDirectory( "sub-c/target" );
+        verifier.deleteDirectory( "sub-d/target" );
+        verifier.getCliOptions().add( "-pl" );
+        verifier.getCliOptions().add( "sub-b" );
+        verifier.getCliOptions().add( "-am" );
+        verifier.setLogFileName( "log-upstream.txt" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFilePresent( "target/touch.txt" );
+        verifier.assertFilePresent( "sub-a/target/touch.txt" );
+        verifier.assertFilePresent( "sub-b/target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-c/target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-d/target/touch.txt" );
+    }
+
+    /**
+     * Verify that project list and all their downstream projects are built.
+     */
+    public void testitMakeDownstream()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2576" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteDirectory( "sub-a/target" );
+        verifier.deleteDirectory( "sub-b/target" );
+        verifier.deleteDirectory( "sub-c/target" );
+        verifier.deleteDirectory( "sub-d/target" );
+        verifier.getCliOptions().add( "-pl" );
+        verifier.getCliOptions().add( "sub-b" );
+        verifier.getCliOptions().add( "-amd" );
+        verifier.setLogFileName( "log-downstream.txt" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFileNotPresent( "target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-a/target/touch.txt" );
+        verifier.assertFilePresent( "sub-b/target/touch.txt" );
+        verifier.assertFilePresent( "sub-c/target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-d/target/touch.txt" );
+    }
+
+    /**
+     * Verify that project list and all their upstream and downstream projects are built.
+     */
+    public void testitMakeBoth()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2576" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteDirectory( "sub-a/target" );
+        verifier.deleteDirectory( "sub-b/target" );
+        verifier.deleteDirectory( "sub-c/target" );
+        verifier.deleteDirectory( "sub-d/target" );
+        verifier.getCliOptions().add( "-pl" );
+        verifier.getCliOptions().add( "sub-b" );
+        verifier.getCliOptions().add( "-am" );
+        verifier.getCliOptions().add( "-amd" );
+        verifier.setLogFileName( "log-both.txt" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFilePresent( "target/touch.txt" );
+        verifier.assertFilePresent( "sub-a/target/touch.txt" );
+        verifier.assertFilePresent( "sub-b/target/touch.txt" );
+        verifier.assertFilePresent( "sub-c/target/touch.txt" );
+        verifier.assertFileNotPresent( "sub-d/target/touch.txt" );
+    }
+
+}

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/pom.xml?rev=792202&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/pom.xml Wed Jul  8 16:02:58 2009
@@ -0,0 +1,61 @@
+<?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.mng2576</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-2576</name>
+  <description>Test make-like reactor mode.</description>
+
+  <modules>
+    <module>sub-a</module>
+    <module>sub-b</module>
+    <module>sub-c</module>
+    <module>sub-d</module>
+  </modules>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-log-file</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <logFile>target/touch.txt</logFile>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>reset</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-a/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-a/pom.xml?rev=792202&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-a/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-a/pom.xml Wed Jul  8 16:02:58 2009
@@ -0,0 +1,37 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng2576</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng2576</groupId>
+  <artifactId>sub-a</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-2576 :: Project A</name>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-b/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-b/pom.xml?rev=792202&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-b/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-b/pom.xml Wed Jul  8 16:02:58 2009
@@ -0,0 +1,45 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng2576</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng2576</groupId>
+  <artifactId>sub-b</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-2576 :: Project B</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng2576</groupId>
+      <artifactId>sub-a</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-c/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-c/pom.xml?rev=792202&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-c/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-c/pom.xml Wed Jul  8 16:02:58 2009
@@ -0,0 +1,45 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng2576</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng2576</groupId>
+  <artifactId>sub-c</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-2576 :: Project C</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng2576</groupId>
+      <artifactId>sub-b</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-d/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-d/pom.xml?rev=792202&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-d/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2576/sub-d/pom.xml Wed Jul  8 16:02:58 2009
@@ -0,0 +1,37 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng2576</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng2576</groupId>
+  <artifactId>sub-d</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-2576 :: Project D</name>
+</project>

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

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