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)

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@713514 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-11-12 21:20:21 +00:00
parent 5054164cf5
commit 262f2c38fc
3 changed files with 77 additions and 19 deletions

View File

@ -23,6 +23,7 @@ import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.Properties;
public class MavenIT0060Test
extends AbstractMavenIntegrationTestCase
@ -37,12 +38,33 @@ public class MavenIT0060Test
{
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" ) );
}
}

View File

@ -23,13 +23,13 @@ under the License.
<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 @@ under the License.
</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>

View File

@ -24,7 +24,7 @@ under the License.
<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 @@ under the License.
<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>