You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2010/07/06 23:40:30 UTC

svn commit: r961020 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/xml/ test/java/org/apache/ivy/plugins/parser/xml/

Author: maartenc
Date: Tue Jul  6 21:40:30 2010
New Revision: 961020

URL: http://svn.apache.org/viewvc?rev=961020&view=rev
Log:
FIX: Ivy info/extends/extendsType attribute is misspelled by XmlModuleDescriptorWriter (IVY-1203) (thanks to Jason Trump)

Added:
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extends.xml   (with props)
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=961020&r1=961019&r2=961020&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Jul  6 21:40:30 2010
@@ -108,6 +108,7 @@ for detailed view of each issue, please 
 	
    trunk
 =====================================
+- FIX: Ivy info/extends/extendsType attribute is misspelled by XmlModuleDescriptorWriter (IVY-1203) (thanks to Jason Trump)
 
    2.2.0-rc1
 =====================================

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java?rev=961020&r1=961019&r2=961020&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java Tue Jul  6 21:40:30 2010
@@ -476,7 +476,7 @@ public final class XmlModuleDescriptorWr
                 if (location != null) {
                     out.print(" location=\"" + XMLHelper.escape(location) + "\"");
                 }
-                out.print(" extendTypes=\"" + StringUtils.join(parent.getExtendsTypes(), ",") + "\"");
+                out.print(" extendType=\"" + StringUtils.join(parent.getExtendsTypes(), ",") + "\"");
                 out.println("/>");
             }
             License[] licenses = md.getLicenses();

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java?rev=961020&r1=961019&r2=961020&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java Tue Jul  6 21:40:30 2010
@@ -26,6 +26,7 @@ import java.util.GregorianCalendar;
 
 import junit.framework.TestCase;
 
+import org.apache.ivy.Ivy;
 import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
@@ -106,6 +107,20 @@ public class XmlModuleDescriptorWriterTe
         assertEquals(expected, wrote);
     }
 
+	public void testExtends() throws Exception {
+		ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(
+		    new IvySettings(), XmlModuleDescriptorWriterTest.class.getResource("test-extends-all.xml"), false);
+		XmlModuleDescriptorWriter.write(md, LICENSE, dest);
+
+		assertTrue(dest.exists());
+		String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(dest)))
+				.replaceAll("\r\n?", "\n");
+		String expected = readEntirely("test-write-extends.xml")
+				.replaceAll("\r\n?", "\n")
+				.replaceAll("working@localhost", Ivy.getWorkingRevision());
+		assertEquals(expected, wrote);
+	}
+
     private String readEntirely(String resource) throws IOException {
         return FileUtil.readEntirely(new BufferedReader(new InputStreamReader(
                 XmlModuleDescriptorWriterTest.class.getResource(resource).openStream())));

Added: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extends.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extends.xml?rev=961020&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extends.xml (added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extends.xml Tue Jul  6 21:40:30 2010
@@ -0,0 +1,44 @@
+<?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.    
+-->
+<ivy-module version="2.2">
+	<info organisation="myorg"
+		module="mymodule"
+		revision="working@localhost"
+		status="integration"
+		publication="20091206000000"
+	>
+		<extends organisation="myorg" module="myparent" revision="myrev" location="test-extends-parent.xml" extendType="all"/>
+		<description>
+		Parent module description.
+		</description>
+	</info>
+	<configurations>
+		<conf name="default" visibility="public"/>
+		<conf name="conf1" visibility="public"/>
+		<conf name="conf2" visibility="private"/>
+	</configurations>
+	<publications>
+		<artifact name="mymodule" type="jar" ext="jar" conf="default,conf1,conf2"/>
+	</publications>
+	<dependencies>
+		<dependency org="myorg" name="mymodule1" rev="1.0" conf="default->default"/>
+		<dependency org="myorg" name="mymodule2" rev="2.0" conf="conf1->conf1;conf2->conf2"/>
+	</dependencies>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extends.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain