Author: xavier
Date: Mon Mar 26 02:48:54 2007
New Revision: 522467

URL: http://svn.apache.org/viewvc?view=rev&rev=522467
Log:
FIX: Conflict managers ignored, when assigned to modules in Ivy settings 
(IVY-448)

Added:
    incubator/ivy/core/trunk/test/repositories/IVY-448/
    incubator/ivy/core/trunk/test/repositories/IVY-448/ivy.xml
    incubator/ivy/core/trunk/test/repositories/IVY-448/ivysettings.xml
    incubator/ivy/core/trunk/test/repositories/IVY-448/module2/
    incubator/ivy/core/trunk/test/repositories/IVY-448/module2/ivy-1.0.xml
    incubator/ivy/core/trunk/test/repositories/IVY-448/module2/module2-1.0.jar
    incubator/ivy/core/trunk/test/repositories/IVY-448/module3/
    incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-1.0.xml
    incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-2.0.xml
    incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-1.0.jar
    incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-2.0.jar
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java
    
incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?view=diff&rev=522467&r1=522466&r2=522467
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Mon Mar 26 02:48:54 2007
@@ -18,6 +18,7 @@
 - IMPROVE: New "modules in use" section in console report at the end of 
resolve (IVY-373) (thanks to John Wiliams)

 - IMPROVE: Generated XML reports now contains more information about the 
resolved module (IVY-446)

 

+- FIX: Conflict managers ignored, when assigned to modules in Ivy 
configuration (setting, ivyconf.xml) (IVY-448)

 - FIX: Ivy should fail if ';' has been used in publications/artifact/@conf of 
ivy.xml (IVY-441)

 - FIX: Ivy should fail where dependency uses undefined configuration (IVY-442)

 - FIX: Dynamic revision not calculated properly when using multiple 
directories (IVY-427)


Modified: 
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?view=diff&rev=522467&r1=522466&r2=522467
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java 
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java 
Mon Mar 26 02:48:54 2007
@@ -879,7 +879,7 @@
             throw new IllegalStateException("impossible to get conflict 
manager when data has not been loaded");

         }

         ConflictManager cm = _md.getConflictManager(mid);

-        return cm == null ? _settings.getDefaultConflictManager() : cm;

+        return cm == null ? _settings.getConflictManager(mid) : cm;

     }

     

     public IvyNode getRealNode() {


Modified: 
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java?view=diff&rev=522467&r1=522466&r2=522467
==============================================================================
--- 
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java
 (original)
+++ 
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java
 Mon Mar 26 02:48:54 2007
@@ -145,6 +145,6 @@
     

 

     public String toString() {

-        return String.valueOf(_strategy);

+        return _strategy != null?String.valueOf(_strategy):_strategyName;

     }

 }


Modified: 
incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?view=diff&rev=522467&r1=522466&r2=522467
==============================================================================
--- 
incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
(original)
+++ 
incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
Mon Mar 26 02:48:54 2007
@@ -243,6 +243,26 @@
         assertFalse(report.hasError());

     }

 

+    public void testResolveWithConflictManagerPerModule() throws Exception {

+        // test case for IVY-448

+       // all modules from myorg

+        // module1 

+       //    -> module2-1.0

+       //    -> module3-2.0

+       // module2

+       //    -> module3-1.0

+       // settings use 'all' as default conflict manager, and latest-revision 
for modules from myorg

+        Ivy ivy = new Ivy();

+        ivy.configure(new 
File("test/repositories/IVY-448/ivysettings.xml").toURL());

+        ResolveReport report = ivy.resolve(new 
File("test/repositories/IVY-448/ivy.xml").toURL(),

+                       getResolveOptions(new String[] {"*"}));

+        assertFalse(report.hasError());

+        

+        // rev 1.0 should have been evicted by latest-revision conflict manager

+        assertTrue(getArchiveFileInCache("myorg", "module3", "2.0", "module3", 
"jar", "jar").exists());

+        assertFalse(getArchiveFileInCache("myorg", "module3", "1.0", 
"module3", "jar", "jar").exists());

+    }

+

     public void testResolveRequiresIvyFile() throws Exception {

         // mod1.1 depends on mod1.2, mod1.2 has no ivy file

         Ivy ivy = new Ivy();


Added: incubator/ivy/core/trunk/test/repositories/IVY-448/ivy.xml
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/ivy.xml?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/ivy.xml (added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/ivy.xml Mon Mar 26 
02:48:54 2007
@@ -0,0 +1,7 @@
+<ivy-module version="1.0">

+    <info organisation="myorg" module="module1"/>

+    <dependencies>

+        <dependency org="myorg" name="module2" rev="1.0" />

+        <dependency org="myorg" name="module3" rev="2.0" />

+       </dependencies>

+</ivy-module>


Added: incubator/ivy/core/trunk/test/repositories/IVY-448/ivysettings.xml
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/ivysettings.xml?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/ivysettings.xml (added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/ivysettings.xml Mon Mar 
26 02:48:54 2007
@@ -0,0 +1,12 @@
+<ivysettings>

+    <settings defaultResolver="myresolver" defaultConflictManager="all"/>

+    <resolvers>

+                       <url name="myresolver">

+                               <ivy 
pattern="${ivy.settings.dir}/[module]/ivy-[revision].xml" />

+                               <artifact 
pattern="${ivy.settings.dir}/[module]/[artifact]-[revision].[ext]" />

+                       </url>

+    </resolvers>

+    <modules>

+        <module organisation="myorg" name=".*" 
conflict-manager="latest-revision"/>

+    </modules>

+</ivysettings>


Added: incubator/ivy/core/trunk/test/repositories/IVY-448/module2/ivy-1.0.xml
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/module2/ivy-1.0.xml?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/module2/ivy-1.0.xml 
(added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/module2/ivy-1.0.xml Mon 
Mar 26 02:48:54 2007
@@ -0,0 +1,6 @@
+<ivy-module version="1.0">

+    <info organisation="myorg" module="module2" revision="1.0"/>

+    <dependencies>

+        <dependency org="myorg" name="module3" rev="1.0" />

+    </dependencies>

+</ivy-module>


Added: 
incubator/ivy/core/trunk/test/repositories/IVY-448/module2/module2-1.0.jar
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/module2/module2-1.0.jar?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/module2/module2-1.0.jar 
(added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/module2/module2-1.0.jar 
Mon Mar 26 02:48:54 2007
@@ -0,0 +1 @@
+.
\ No newline at end of file

Added: incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-1.0.xml
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-1.0.xml?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-1.0.xml 
(added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-1.0.xml Mon 
Mar 26 02:48:54 2007
@@ -0,0 +1,3 @@
+<ivy-module version="1.0">

+    <info organisation="myorg" module="module3" revision="1.0"/>

+</ivy-module>


Added: incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-2.0.xml
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-2.0.xml?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-2.0.xml 
(added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/module3/ivy-2.0.xml Mon 
Mar 26 02:48:54 2007
@@ -0,0 +1,3 @@
+<ivy-module version="1.0">

+    <info organisation="myorg" module="module3" revision="2.0"/>

+</ivy-module>


Added: 
incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-1.0.jar
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-1.0.jar?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-1.0.jar 
(added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-1.0.jar 
Mon Mar 26 02:48:54 2007
@@ -0,0 +1 @@
+.
\ No newline at end of file

Added: 
incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-2.0.jar
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-2.0.jar?view=auto&rev=522467
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-2.0.jar 
(added)
+++ incubator/ivy/core/trunk/test/repositories/IVY-448/module3/module3-2.0.jar 
Mon Mar 26 02:48:54 2007
@@ -0,0 +1 @@
+.
\ No newline at end of file


Reply via email to