o Created UT from MNG-3937

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@728725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-12-22 16:59:19 +00:00
parent 50f8ed0dac
commit 52d13db42f
5 changed files with 260 additions and 0 deletions

View File

@ -178,6 +178,32 @@ public class PomConstructionTest
}
//*/
/* FIXME: cf. MNG-3937
public void testOrderOfMergedPluginExecutionGoalsWithoutPluginManagement()
throws Exception
{
PomTestWrapper pom = buildPom( "merged-plugin-exec-goals-order/wo-plugin-mngt/sub" );
assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() );
assertEquals( "child-a", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) );
assertEquals( "merged", pom.getValue( "build/plugins[1]/executions[1]/goals[2]" ) );
assertEquals( "child-b", pom.getValue( "build/plugins[1]/executions[1]/goals[3]" ) );
assertEquals( "parent-b", pom.getValue( "build/plugins[1]/executions[1]/goals[4]" ) );
assertEquals( "parent-a", pom.getValue( "build/plugins[1]/executions[1]/goals[5]" ) );
}
public void testOrderOfMergedPluginExecutionGoalsWithPluginManagement()
throws Exception
{
PomTestWrapper pom = buildPom( "merged-plugin-exec-goals-order/w-plugin-mngt/sub" );
assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() );
assertEquals( "child-a", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) );
assertEquals( "merged", pom.getValue( "build/plugins[1]/executions[1]/goals[2]" ) );
assertEquals( "child-b", pom.getValue( "build/plugins[1]/executions[1]/goals[3]" ) );
assertEquals( "parent-b", pom.getValue( "build/plugins[1]/executions[1]/goals[4]" ) );
assertEquals( "parent-a", pom.getValue( "build/plugins[1]/executions[1]/goals[5]" ) );
}
//*/
private PomArtifactResolver artifactResolver( String basedir )
{
return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) );

View File

@ -0,0 +1,59 @@
<?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.mng3937</groupId>
<artifactId>parent-2</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-3937</name>
<description>
Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly
ordered.
</description>
<build>
<!-- This project uses plugin management for the test plugin -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>merge</id>
<phase>validate</phase>
<goals>
<goal>parent-b</goal>
<goal>merged</goal>
<goal>parent-a</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -0,0 +1,59 @@
<?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.mng3937</groupId>
<artifactId>parent-2</artifactId>
<version>0.1</version>
</parent>
<artifactId>child-2</artifactId>
<name>Maven Integration Test :: MNG-3937</name>
<description>
Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly
ordered.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>merge</id>
<phase>validate</phase>
<goals>
<goal>child-a</goal>
<goal>merged</goal>
<goal>child-b</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,57 @@
<?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.mng3937</groupId>
<artifactId>parent-1</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-3937</name>
<description>
Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly
ordered.
</description>
<build>
<!-- This project does not use plugin management for the test plugin -->
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>merge</id>
<phase>validate</phase>
<goals>
<goal>parent-b</goal>
<goal>merged</goal>
<goal>parent-a</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,59 @@
<?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.mng3937</groupId>
<artifactId>parent-1</artifactId>
<version>0.1</version>
</parent>
<artifactId>child-1</artifactId>
<name>Maven Integration Test :: MNG-3937</name>
<description>
Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly
ordered.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>merge</id>
<phase>validate</phase>
<goals>
<goal>child-a</goal>
<goal>merged</goal>
<goal>child-b</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>