o Created UT from MNG-3906

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@729499 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-12-26 15:12:07 +00:00
parent ea3c2217af
commit d186d9996c
5 changed files with 290 additions and 0 deletions

View File

@ -235,6 +235,42 @@ public class PomConstructionTest
} }
//*/ //*/
/* FIXME: cf. MNG-3906
public void testOrderOfMergedPluginDependenciesWithoutPluginManagement()
throws Exception
{
PomTestWrapper pom = buildPom( "merged-plugin-class-path-order/wo-plugin-mngt/sub" );
assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() );
assertEquals( "c", pom.getValue( "build/plugins[1]/dependency[1]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[1]/version" ) );
assertEquals( "a", pom.getValue( "build/plugins[1]/dependency[2]/artifactId" ) );
assertEquals( "2", pom.getValue( "build/plugins[1]/dependency[2]/version" ) );
assertEquals( "b", pom.getValue( "build/plugins[1]/dependency[3]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[3]/version" ) );
assertEquals( "e", pom.getValue( "build/plugins[1]/dependency[4]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[4]/version" ) );
assertEquals( "e", pom.getValue( "build/plugins[1]/dependency[5]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[5]/version" ) );
}
public void testOrderOfMergedPluginDependenciesWithPluginManagement()
throws Exception
{
PomTestWrapper pom = buildPom( "merged-plugin-class-path-order/w-plugin-mngt/sub" );
assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() );
assertEquals( "c", pom.getValue( "build/plugins[1]/dependency[1]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[1]/version" ) );
assertEquals( "a", pom.getValue( "build/plugins[1]/dependency[2]/artifactId" ) );
assertEquals( "2", pom.getValue( "build/plugins[1]/dependency[2]/version" ) );
assertEquals( "b", pom.getValue( "build/plugins[1]/dependency[3]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[3]/version" ) );
assertEquals( "e", pom.getValue( "build/plugins[1]/dependency[4]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[4]/version" ) );
assertEquals( "e", pom.getValue( "build/plugins[1]/dependency[5]/artifactId" ) );
assertEquals( "1", pom.getValue( "build/plugins[1]/dependency[5]/version" ) );
}
//*/
private PomArtifactResolver artifactResolver( String basedir ) private PomArtifactResolver artifactResolver( String basedir )
{ {
return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) ); return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) );

View File

@ -0,0 +1,64 @@
<?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.mng3906</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-3906</name>
<description>
Test that project-level plugin dependencies are properly merged during inheritance.
</description>
<build>
<!-- NOTE: This parent uses plugin management -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-class-loader</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>e</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>a</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>d</artifactId>
<version>1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -0,0 +1,64 @@
<?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.mng3906</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
</parent>
<artifactId>child</artifactId>
<name>Maven Integration Test :: MNG-3906</name>
<description>
Test that project-level plugin dependencies are properly merged during inheritance.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-class-loader</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>c</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>a</artifactId>
<version>2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>b</artifactId>
<version>1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,62 @@
<?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.mng3906</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-3906</name>
<description>
Test that project-level plugin dependencies are properly merged during inheritance.
</description>
<build>
<!-- NOTE: This parent does not use plugin management -->
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-class-loader</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>e</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>a</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>d</artifactId>
<version>1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,64 @@
<?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.mng3906</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
</parent>
<artifactId>child</artifactId>
<name>Maven Integration Test :: MNG-3906</name>
<description>
Test that project-level plugin dependencies are properly merged during inheritance.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-class-loader</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>c</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>a</artifactId>
<version>2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.its.mng3906</groupId>
<artifactId>b</artifactId>
<version>1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>