Author: maartenc
Date: Thu May 22 14:40:17 2008
New Revision: 659266
URL: http://svn.apache.org/viewvc?rev=659266&view=rev
Log:
Added junit test for IVY-811
Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=659266&r1=659265&r2=659266&view=diff
==============================================================================
---
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
(original)
+++
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
Thu May 22 14:40:17 2008
@@ -495,7 +495,24 @@
dds[0].getDependencyRevisionId());
assertEquals("There is no special artifact when there is no
classifier",
0, dds[0].getAllDependencyArtifacts().length);
-
+ }
+
+ public void testDependencyManagmentWithScope() throws ParseException,
IOException {
+ ModuleDescriptor md =
PomModuleDescriptorParser.getInstance().parseDescriptor(
+ settings,
getClass().getResource("test-dependencyMgt-with-scope.pom"), false);
+ assertNotNull(md);
+ assertEquals(ModuleRevisionId.newInstance("org.apache", "test-depMgt",
"1.1"),
+ md.getModuleRevisionId());
+
+ DependencyDescriptor[] dds = md.getDependencies();
+ assertNotNull(dds);
+ assertEquals(1, dds.length);
+ assertEquals(ModuleRevisionId.newInstance("commons-logging",
"commons-logging", "1.0.4"),
+ dds[0].getDependencyRevisionId());
+ assertEquals("There is no special artifact when there is no
classifier",
+ 0, dds[0].getAllDependencyArtifacts().length);
+ assertEquals("The number of configurations is incorrect", 1,
dds[0].getModuleConfigurations().length);
+ assertEquals("The configuration must be test", "test",
dds[0].getModuleConfigurations()[0]);
}
public void testParentDependencyMgt() throws ParseException, IOException {
Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom?rev=659266&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
(added)
+++
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
Thu May 22 14:40:17 2008
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ 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</groupId>
+ <artifactId>test-depMgt</artifactId>
+ <name>Test Module for Ivy M2 parsing</name>
+ <version>1.1</version>
+ <url>http://ivy.jayasoft.org/</url>
+ <organization>
+ <name>Jayasoft</name>
+ <url>http://www.jayasoft.org/</url>
+ </organization>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-collection</groupId>
+ <artifactId>commons-collection</artifactId>
+ <version>1.0.5</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ </dependencies>
+</project>