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 2011/02/12 14:51:32 UTC

svn commit: r1070081 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-5009/

Author: bentmann
Date: Sat Feb 12 13:51:31 2011
New Revision: 1070081

URL: http://svn.apache.org/viewvc?rev=1070081&view=rev
Log:
[MNG-5009] StackOverflowError in DefaultProjectBuilder.build when <module> points at current aggregator POM

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom-2.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/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=1070081&r1=1070080&r2=1070081&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 Sat Feb 12 13:51:31 2011
@@ -83,6 +83,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5009AggregationCycleTest.class );
         // suite.addTestSuite( MavenITmng4992MapStylePropertiesParamConfigTest.class );
         suite.addTestSuite( MavenITmng4975ProfileInjectedPluginExecutionOrderTest.class );
         suite.addTestSuite( MavenITmng4973ExtensionVisibleToPluginInReactorTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java?rev=1070081&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5009AggregationCycleTest.java Sat Feb 12 13:51:31 2011
@@ -0,0 +1,67 @@
+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.Properties;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5009">MNG-5009</a>.
+ */
+public class MavenITmng5009AggregationCycleTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5009AggregationCycleTest()
+    {
+        super( "[3.0.3,)" );
+    }
+
+    /**
+     * Verify that aggregators POMs forming a cycle fail gracefully with a proper error message.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5009" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        try
+        {
+            verifier.executeGoal( "validate" );
+            verifier.verifyErrorFreeLog();
+            fail( "Build did not fail despite cycle in POM aggregation" );
+        }
+        catch ( Exception e )
+        {
+            verifier.verifyTextInLog( " cycle " );
+        }
+        finally
+        {
+            verifier.resetStreams();
+        }
+    }
+
+}

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom-2.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom-2.xml?rev=1070081&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom-2.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom-2.xml Sat Feb 12 13:51:31 2011
@@ -0,0 +1,38 @@
+<?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.mng5009</groupId>
+  <artifactId>sub</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-5009 :: Child</name> 
+  <description>
+    Verify that aggregators POMs forming a cycle fail gracefully with a proper error message.
+  </description>
+
+  <modules>
+    <module>pom.xml</module>
+  </modules>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom.xml?rev=1070081&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5009/pom.xml Sat Feb 12 13:51:31 2011
@@ -0,0 +1,38 @@
+<?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.mng5009</groupId>
+  <artifactId>test</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-5009</name> 
+  <description>
+    Verify that aggregators POMs forming a cycle fail gracefully with a proper error message.
+  </description>
+
+  <modules>
+    <module>pom-2.xml</module>
+  </modules>
+</project>

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

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