You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Stephane Bailliez (JIRA)" <ji...@apache.org> on 2007/01/07 14:03:27 UTC
[jira] Commented: (IVY-374) XmlModuleDescriptorWriterTest is broken
[ https://issues.apache.org/jira/browse/IVY-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462827 ]
Stephane Bailliez commented on IVY-374:
---------------------------------------
Snippet below (from the testFull() failing method):
JDK6 output:
<dependency org="yourorg" name="yourmodule9" rev="9.1" conf="myconf3->default;myconf2->default;myconf1->default">
<include name="yourartifact9-2" type="jar" ext="jar" conf="myconf2,myconf3"/>
<include name="yourartifact9-1" type="jar" ext="jar" conf="myconf1,myconf2"/>
</dependency>
<dependency org="yourorg" name="yourmodule10" rev="10.1" conf="*->*">
<include name="your.*" type="jar" ext="jar"/>
<include name="*" type="*" ext="xml"/>
<exclude org="*" module="*" name="toexclude" type="*" ext="*"/>
</dependency>
JDK5 output:
<dependency org="yourorg" name="yourmodule9" rev="9.1" conf="myconf2->default;myconf3->default;myconf1->default">
<include name="yourartifact9-1" type="jar" ext="jar" conf="myconf1,myconf2"/>
<include name="yourartifact9-2" type="jar" ext="jar" conf="myconf2,myconf3"/>
</dependency>
<dependency org="yourorg" name="yourmodule10" rev="10.1" conf="*->*">
<include name="*" type="*" ext="xml"/>
<include name="your.*" type="jar" ext="jar"/>
<exclude org="*" module="*" name="toexclude" type="*" ext="*"/>
</dependency>
> XmlModuleDescriptorWriterTest is broken
> ---------------------------------------
>
> Key: IVY-374
> URL: https://issues.apache.org/jira/browse/IVY-374
> Project: Ivy
> Issue Type: Bug
> Affects Versions: 1.4.1
> Reporter: Stephane Bailliez
> Priority: Minor
> Fix For: 1.5
>
>
> XmlModuleDescriptorWriterTest is using pure String comparison of serialized module descriptor.
> From a quick look, this does not work as it relies on ordering of values within a HashMap so it can only work if the ordering of the hashmap is the same as the one that was done when serializing the file used for reference.
> So if you try running the test with Sun JDK 6 it will fail while it will work with Sun JDK 5 since the hash method used as a default has been changed.
> To fix it as I can see right now:
> 1) you guarantee ordering and sort each element (lexicographically ?) within XmlModuleDescriptorWriter when serializing things
> 2) you don't guarantee ordering but you implement equals method for DefaultModuleDescriptor (which I assume will have a cascading effect for other classes)
> I think 1) makes more sense for now and we should go toward 2) so that more comparisons of objects can be done using equals() (esp. as there are a lot of objects that end up in maps)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira