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 2008/11/15 14:26:47 UTC

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

Author: bentmann
Date: Sat Nov 15 05:26:47 2008
New Revision: 714252

URL: http://svn.apache.org/viewvc?rev=714252&view=rev
Log:
[MNG-3845] Unintended inheritance of parent elements overriden by children

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/child/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/child/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/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=714252&r1=714251&r2=714252&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 Nov 15 05:26:47 2008
@@ -88,6 +88,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng3845LimitedPomInheritanceTest.class );
         suite.addTestSuite( MavenITmng3843PomInheritanceTest.class );
         suite.addTestSuite( MavenITmng3839PomParsingCoalesceTextTest.class );
         suite.addTestSuite( MavenITmng3838EqualPluginDepsTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java?rev=714252&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3845LimitedPomInheritanceTest.java Sat Nov 15 05:26:47 2008
@@ -0,0 +1,70 @@
+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-3845">MNG-3845</a>.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng3845LimitedPomInheritanceTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng3845LimitedPomInheritanceTest()
+    {
+    }
+
+    /**
+     * Test that inheritance is all-or-nothing for certain sub-trees of the POM.
+     */
+    public void testitMNG3845()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3845" );
+
+        Verifier verifier = new Verifier( new File( testDir, "child" ).getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( "target/pom.properties" );
+        assertEquals( "", props.getProperty( "project.organization.url", "" ) );
+        assertEquals( "", props.getProperty( "project.issueManagement.system", "" ) );
+        assertEquals( "0", props.getProperty( "project.ciManagement.notifiers", "0" ) );
+        assertEquals( "", props.getProperty( "project.distributionManagement.repository.name", "" ) );
+        assertEquals( "true", props.getProperty( "project.distributionManagement.repository.uniqueVersion", "true" ) );
+        assertEquals( "default", props.getProperty( "project.distributionManagement.repository.layout", "default" ) );
+        assertEquals( "", props.getProperty( "project.distributionManagement.snapshotRepository.name", "" ) );
+        assertEquals( "true", props.getProperty( "project.distributionManagement.snapshotRepository.uniqueVersion", "true" ) );
+        assertEquals( "default", props.getProperty( "project.distributionManagement.snapshotRepository.layout", "default" ) );
+        assertEquals( "", props.getProperty( "project.distributionManagement.site.name", "" ) );
+    }
+
+}

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/child/pom.xml?rev=714252&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/child/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/child/pom.xml Sat Nov 15 05:26:47 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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng3845</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1</version>
+  </parent>
+
+  <artifactId>child</artifactId>
+
+  <organization>
+    <name>child-org</name>
+  </organization>
+
+  <scm>
+    <developerConnection>https://child.url/scm</developerConnection>
+  </scm>
+  <issueManagement>
+    <url>http://child.url/issues</url>
+  </issueManagement>
+  <ciManagement>
+    <system>child-ci</system>
+    <url>http://child.url/ci</url>
+  </ciManagement>
+  <distributionManagement>
+    <repository>
+      <id>child-distros</id>
+      <url>ssh://child.url/distros</url>
+    </repository>
+    <snapshotRepository>
+      <id>child-snaps</id>
+      <url>ssh://child.url/snaps</url>
+    </snapshotRepository>
+    <site>
+      <id>child-site</id>
+      <url>scp://child.url/site</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+            <configuration>
+              <outputFile>target/pom.properties</outputFile>
+              <expressions>
+                <expression>project/organization</expression>
+                <expression>project/scm</expression>
+                <expression>project/ciManagement</expression>
+                <expression>project/issueManagement</expression>
+                <expression>project/distributionManagement</expression>
+              </expressions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/pom.xml?rev=714252&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3845/pom.xml Sat Nov 15 05:26:47 2008
@@ -0,0 +1,87 @@
+<?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.mng3845</groupId>
+  <artifactId>parent</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-3845</name> 
+  <description>
+    Test that inheritance is all-or-nothing for certain sub-trees of the POM.
+  </description>
+
+  <organization>
+    <name>parent-org</name>
+    <url>http://parent.url/org</url>
+  </organization>
+
+  <scm>
+    <url>http://parent.url/viewvc</url>
+    <connection>http://parent.url/scm</connection>
+    <developerConnection>https://parent.url/scm</developerConnection>
+    <tag>parent-tag</tag>
+  </scm>
+  <issueManagement>
+    <system>parent-issues</system>
+    <url>http://parent.url/issues</url>
+  </issueManagement>
+  <ciManagement>
+    <system>parent-ci</system>
+    <url>http://parent.url/ci</url>
+    <notifiers>
+      <notifier>
+        <type>irc</type>
+        <sendOnError>true</sendOnError>
+        <sendOnFailure>true</sendOnFailure>
+        <sendOnSuccess>false</sendOnSuccess>
+        <sendOnWarning>false</sendOnWarning>
+        <configuration>
+          <address>irc://parent.url/#ci</address>
+        </configuration>
+      </notifier>
+    </notifiers>
+  </ciManagement>
+  <distributionManagement>
+    <repository>
+      <id>parent-distros</id>
+      <name>parent-distros</name>
+      <url>ssh://parent.url/distros</url>
+      <uniqueVersion>false</uniqueVersion>
+      <layout>legacy</layout>
+    </repository>
+    <snapshotRepository>
+      <id>parent-snaps</id>
+      <name>parent-snaps</name>
+      <url>ssh://parent.url/snaps</url>
+      <uniqueVersion>false</uniqueVersion>
+      <layout>legacy</layout>
+    </snapshotRepository>
+    <site>
+      <id>parent-site</id>
+      <name>parent-site</name>
+      <url>scp://parent.url/site</url>
+    </site>
+  </distributionManagement>
+</project>

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

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