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/12 22:20:21 UTC
svn commit: r713514 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/MavenIT0060Test.java resources/it0060/pom.xml
resources/it0060/subproject/pom.xml
Author: bentmann
Date: Wed Nov 12 13:20:21 2008
New Revision: 713514
URL: http://svn.apache.org/viewvc?rev=713514&view=rev
Log:
o Extended IT to check for proper ordering of merged collections
(c.f. http://docs.codehaus.org/display/MAVENUSER/FAQs-1#FAQs-1-HowdoImergealistofconfigurationitemsinaparentPOMwiththoseinachildPOM%3F)
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0060Test.java
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/pom.xml
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/subproject/pom.xml
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0060Test.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0060Test.java?rev=713514&r1=713513&r2=713514&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0060Test.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0060Test.java Wed Nov 12 13:20:21 2008
@@ -23,6 +23,7 @@
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
+import java.util.Properties;
public class MavenIT0060Test
extends AbstractMavenIntegrationTestCase
@@ -37,12 +38,33 @@
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0060" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
- verifier.executeGoal( "initialize" );
- verifier.assertFilePresent( "parent.txt" );
- verifier.assertFilePresent( "child.txt" );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "subproject/target" );
+ verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
+ Properties props = verifier.loadProperties( "subproject/target/config.properties" );
+
+ assertEquals( "8", props.getProperty( "stringParams" ) );
+ assertEquals( "PARENT-1", props.getProperty( "stringParams.0" ) );
+ assertEquals( "PARENT-3", props.getProperty( "stringParams.1" ) );
+ assertEquals( "PARENT-2", props.getProperty( "stringParams.2" ) );
+ assertEquals( "PARENT-4", props.getProperty( "stringParams.3" ) );
+ assertEquals( "CHILD-1", props.getProperty( "stringParams.4" ) );
+ assertEquals( "CHILD-3", props.getProperty( "stringParams.5" ) );
+ assertEquals( "CHILD-2", props.getProperty( "stringParams.6" ) );
+ assertEquals( "CHILD-4", props.getProperty( "stringParams.7" ) );
+
+ assertEquals( "8", props.getProperty( "listParam" ) );
+ assertEquals( "PARENT-1", props.getProperty( "listParam.0" ) );
+ assertEquals( "PARENT-3", props.getProperty( "listParam.1" ) );
+ assertEquals( "PARENT-2", props.getProperty( "listParam.2" ) );
+ assertEquals( "PARENT-4", props.getProperty( "listParam.3" ) );
+ assertEquals( "CHILD-1", props.getProperty( "listParam.4" ) );
+ assertEquals( "CHILD-3", props.getProperty( "listParam.5" ) );
+ assertEquals( "CHILD-2", props.getProperty( "listParam.6" ) );
+ assertEquals( "CHILD-4", props.getProperty( "listParam.7" ) );
}
-}
+}
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/pom.xml?rev=713514&r1=713513&r2=713514&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/pom.xml Wed Nov 12 13:20:21 2008
@@ -23,13 +23,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.it0060</groupId>
- <artifactId>maven-it-it0060</artifactId>
+ <artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: it0060</name>
<description>
- Test aggregation of list configuration items when using
+ Test aggregation of list configuration items for build plugins when using
'combine.children=append' attribute.
</description>
@@ -38,16 +38,41 @@
</modules>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <!-- inherit via <pluginManagement> -->
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-configuration</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <inherited>true</inherited>
+ <configuration>
+ <listParam>
+ <!-- NOTE: These values are deliberately not in alpha order! -->
+ <listParam>PARENT-1</listParam>
+ <listParam>PARENT-3</listParam>
+ <listParam>PARENT-2</listParam>
+ <listParam>PARENT-4</listParam>
+ </listParam>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
+ <!-- inherit not via <pluginManagement> -->
<groupId>org.apache.maven.its.plugins</groupId>
- <artifactId>maven-it-plugin-file</artifactId>
+ <artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<inherited>true</inherited>
<configuration>
- <pathnames>
- <pathname>parent.txt</pathname>
- </pathnames>
+ <stringParams>
+ <!-- NOTE: These values are deliberately not in alpha order! -->
+ <stringParam>PARENT-1</stringParam>
+ <stringParam>PARENT-3</stringParam>
+ <stringParam>PARENT-2</stringParam>
+ <stringParam>PARENT-4</stringParam>
+ </stringParams>
</configuration>
</plugin>
</plugins>
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/subproject/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/subproject/pom.xml?rev=713514&r1=713513&r2=713514&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/subproject/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0060/subproject/pom.xml Wed Nov 12 13:20:21 2008
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.maven.its.it0060</groupId>
- <artifactId>maven-it-it0060</artifactId>
+ <artifactId>parent</artifactId>
<version>1.0</version>
</parent>
@@ -36,20 +36,31 @@
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
- <artifactId>maven-it-plugin-file</artifactId>
+ <artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
- <inherited>true</inherited>
<configuration>
- <pathnames combine.children="append">
- <pathname>child.txt</pathname>
- </pathnames>
+ <propertiesFile>target/config.properties</propertiesFile>
+ <stringParams combine.children="append">
+ <!-- NOTE: These values are deliberately not in alpha order! -->
+ <stringParam>CHILD-1</stringParam>
+ <stringParam>CHILD-3</stringParam>
+ <stringParam>CHILD-2</stringParam>
+ <stringParam>CHILD-4</stringParam>
+ </stringParams>
+ <listParam combine.children="append">
+ <!-- NOTE: These values are deliberately not in alpha order! -->
+ <listParam>CHILD-1</listParam>
+ <listParam>CHILD-3</listParam>
+ <listParam>CHILD-2</listParam>
+ <listParam>CHILD-4</listParam>
+ </listParam>
</configuration>
<executions>
<execution>
<id>test</id>
- <phase>initialize</phase>
+ <phase>validate</phase>
<goals>
- <goal>files</goal>
+ <goal>config</goal>
</goals>
</execution>
</executions>