o Created UT for MNG-3836

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@737071 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-23 16:28:48 +00:00
parent 2e4285f616
commit 67c93459cc
4 changed files with 168 additions and 120 deletions

View File

@ -91,7 +91,7 @@ public class PomConstructionTest
assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() );
}
/* FIXME: cf. MNG-3821
/** MNG-3821 */
public void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds()
throws Exception
{
@ -105,7 +105,6 @@ public class PomConstructionTest
assertEquals( "maven-it-plugin-b", pom.getValue( "reporting/plugins[2]/artifactId" ) );
assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() );
}
//*/
/** MNG-3965 */
public void testExecutionConfigurationSubcollections()
@ -127,7 +126,6 @@ public class PomConstructionTest
throws Exception
{
PomTestWrapper pom = buildPom( "dual-execution-ids/sub" );
// System.out.println(pom.getDomainModel().asString());
assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() );
}
@ -520,6 +518,25 @@ public class PomConstructionTest
}
//*/
/* FIXME: cf. MNG-3836
public void testMergeOfInheritedPluginConfiguration()
throws Exception
{
PomTestWrapper pom = buildPom( "plugin-config-merging/child" );
String prefix = "build/plugins[1]/configuration/";
assertEquals( "PASSED", pom.getValue( prefix + "propertiesFile" ) );
assertEquals( "PASSED", pom.getValue( prefix + "parent" ) );
assertEquals( "PASSED-1", pom.getValue( prefix + "stringParams/stringParam[1]" ) );
assertEquals( "PASSED-2", pom.getValue( prefix + "stringParams/stringParam[2]" ) );
assertEquals( "PASSED-3", pom.getValue( prefix + "stringParams/stringParam[3]" ) );
assertEquals( "PASSED-4", pom.getValue( prefix + "stringParams/stringParam[4]" ) );
assertEquals( "PASSED-1", pom.getValue( prefix + "listParam/listParam[1]" ) );
assertEquals( "PASSED-2", pom.getValue( prefix + "listParam/listParam[2]" ) );
assertEquals( "PASSED-3", pom.getValue( prefix + "listParam/listParam[3]" ) );
assertEquals( "PASSED-4", pom.getValue( prefix + "listParam/listParam[4]" ) );
}
//*/
private PomArtifactResolver artifactResolver( String basedir )
{
return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) );

View File

@ -0,0 +1,76 @@
<?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.mng3836</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.maven.its.mng3836</groupId>
<artifactId>child</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Maven Integration Test :: MNG-3836</name>
<description>
Verify that children can *override* inherited plugin configuration.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<!--
All of these values should override the ones inherited from the parent. In particular, collections should not
be merged with the values given by the parent POM.
-->
<propertiesFile>PASSED</propertiesFile>
<stringParams>
<stringParam>PASSED-1</stringParam>
<stringParam>PASSED-3</stringParam>
<stringParam>PASSED-2</stringParam>
<stringParam>PASSED-4</stringParam>
</stringParams>
<listParam>
<listParam>PASSED-1</listParam>
<listParam>PASSED-3</listParam>
<listParam>PASSED-2</listParam>
<listParam>PASSED-4</listParam>
</listParam>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>config</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,72 @@
<?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.mng3836</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-3836</name>
<description>
Verify that children can *override* inherited plugin configuration.
</description>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<propertiesFile>FAILED</propertiesFile>
<stringParams>
<stringParam>FAILED-1</stringParam>
<stringParam>FAILED-3</stringParam>
<stringParam>FAILED-2</stringParam>
<stringParam>FAILED-4</stringParam>
</stringParams>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<propertiesFile>FAILED</propertiesFile>
<listParam>
<listParam>FAILED-1</listParam>
<listParam>FAILED-3</listParam>
<listParam>FAILED-2</listParam>
<listParam>FAILED-4</listParam>
</listParam>
<parent>PASSED</parent>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,117 +0,0 @@
<?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.mng3864</groupId>
<artifactId>test1</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Maven Integration Test :: MNG-3864</name>
<description>
Verify that plain per-execution plugin configuration works correctly.
</description>
<build>
<pluginManagement>
<!--
NOTE: The usage of <pluginManagement> for the employed IT plugin is crucial to exhibit the bug!
-->
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>config</goal>
</goals>
<configuration>
<propertiesFile>target/plugin-config.properties</propertiesFile>
<booleanParam>true</booleanParam>
<byteParam>42</byteParam>
<shortParam>-12345</shortParam>
<integerParam>0</integerParam>
<longParam>9876543210</longParam>
<floatParam>0.0</floatParam>
<doubleParam>-1.5</doubleParam>
<characterParam>X</characterParam>
<stringParam>Hello World!</stringParam>
<fileParam>pom.xml</fileParam>
<dateParam>2008-11-09 11:59:03.0 PM</dateParam>
<urlParam>http://maven.apache.org/</urlParam>
<stringParams>
<stringParam>one</stringParam>
<stringParam>two</stringParam>
<stringParam>three</stringParam>
<stringParam>four</stringParam>
</stringParams>
<listParam>
<listParam>one</listParam>
<listParam>two</listParam>
<listParam>three</listParam>
<listParam>four</listParam>
</listParam>
<setParam>
<setParam>item</setParam>
<setParam>item</setParam>
</setParam>
<mapParam>
<key1>value1</key1>
<key2>value2</key2>
</mapParam>
<propertiesParam>
<property>
<name>key1</name>
<value>value1</value>
</property>
<property>
<name>key2</name>
<value>value2</value>
</property>
</propertiesParam>
<beanParam>
<fieldParam>field</fieldParam>
<setterParam>setter</setterParam>
</beanParam>
<domParam>
<echo>one</echo>
<echo>two</echo>
<echo>three</echo>
<echo>four</echo>
</domParam>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>