incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r515980 - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/core/resolve/ src/java/org/apache/ivy/plugins/resolver/ test/java/org/apache/ivy/plugins/conflict/
Date Thu, 08 Mar 2007 09:17:57 GMT
Author: xavier
Date: Thu Mar  8 01:17:54 2007
New Revision: 515980

URL: http://svn.apache.org/viewvc?view=rev&rev=515980
Log:
FIX: bad tests for conflict managers use the ivy default cache instead of a fresh one
FIX: set last modified from artifact resource when generating default ivy file (related to
IVY-407)

Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml

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=515980&r1=515979&r2=515980
==============================================================================
--- 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 Thu Mar  8
01:17:54 2007
@@ -20,6 +20,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java Thu
Mar  8 01:17:54 2007
@@ -221,6 +221,10 @@
                 }
                 return null;
             } else {
+            	long lastModified = artifactRef.getLastModified();
+            	if (lastModified != 0 && md instanceof DefaultModuleDescriptor) {
+            		((DefaultModuleDescriptor) md).setLastModified(lastModified);
+            	}
                 Message.verbose("\t"+getName()+": no ivy file found for "+mrid+": using default
data");            
                 logIvyNotFound(mrid);
     	        if (isDynamic) {

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java
Thu Mar  8 01:17:54 2007
@@ -30,15 +30,23 @@
 import org.apache.ivy.core.report.ResolveReport;
 import org.apache.ivy.core.resolve.IvyNode;
 import org.apache.ivy.core.resolve.ResolveOptions;
+import org.apache.ivy.util.FileUtil;
 
 public class LatestConflictManagerTest extends TestCase {
 
 	private Ivy ivy;
+    private File _cache;
 
 	protected void setUp() throws Exception {
 		ivy = new Ivy();
 		ivy.configure(LatestConflictManagerTest.class
 				.getResource("ivyconf-latest.xml"));
+        _cache = new File("build/cache");
+        _cache.mkdirs();
+	}
+	
+	protected void tearDown() throws Exception {
+		FileUtil.forceDelete(_cache);
 	}
 
 	// Test case for issue IVY-388

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java
Thu Mar  8 01:17:54 2007
@@ -21,23 +21,33 @@
  * @author Anders janmyr
  */
 
+import java.io.File;
+
 import junit.framework.TestCase;
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.cache.CacheManager;
 import org.apache.ivy.core.resolve.ResolveOptions;
+import org.apache.ivy.util.FileUtil;
 
 
 public class RegexpConflictManagerTest extends TestCase
 {
     private Ivy ivy;
+    private File _cache;
 
     protected void setUp() throws Exception
     {
         ivy = new Ivy();
         ivy.configure( RegexpConflictManagerTest.class
                 .getResource( "ivyconf-regexp-test.xml" ) );
+        _cache = new File("build/cache");
+        _cache.mkdirs();
     }
+	
+	protected void tearDown() throws Exception {
+		FileUtil.forceDelete(_cache);
+	}
 
     public void testNoApiConflictResolve() throws Exception
     {

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java
Thu Mar  8 01:17:54 2007
@@ -17,18 +17,29 @@
  */
 package org.apache.ivy.plugins.conflict;
 
+import java.io.File;
+
 import junit.framework.TestCase;
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.cache.CacheManager;
 import org.apache.ivy.core.resolve.ResolveOptions;
+import org.apache.ivy.util.FileUtil;
 
 public class StrictConflictManagerTest extends TestCase {
 	private Ivy ivy;
+    private File _cache;
+
     protected void setUp() throws Exception {
         ivy = new Ivy();
         ivy.configure(StrictConflictManagerTest.class.getResource("ivyconf-strict-test.xml"));
+        _cache = new File("build/cache");
+        _cache.mkdirs();
     }
+	
+	protected void tearDown() throws Exception {
+		FileUtil.forceDelete(_cache);
+	}
 
     public void testInitFromConf() throws Exception {
         ConflictManager cm = ivy.getSettings().getDefaultConflictManager();

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml
Thu Mar  8 01:17:54 2007
@@ -1,6 +1,6 @@
 <ivyconf>
 
-    <conf defaultResolver="test" defaultConflictManager="latest-time" />
+    <conf defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-time"
/>
 
     <resolvers>
        <filesystem name="test" latest="latest-time" checkmodified="true">

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml
Thu Mar  8 01:17:54 2007
@@ -1,6 +1,6 @@
 <ivyconf>
 
-    <conf defaultResolver="test" defaultConflictManager="latest-time" />
+    <conf defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-time"
/>
 
     <resolvers>
         <filesystem name="test">

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml
Thu Mar  8 01:17:54 2007
@@ -1,6 +1,6 @@
 <ivyconf>
 
-    <conf defaultResolver="test"/>
+    <conf defaultCache="build/cache" defaultResolver="test"/>
 
     <resolvers>
         <filesystem name="test">

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml
Thu Mar  8 01:17:54 2007
@@ -1,6 +1,7 @@
 <ivyconf>
 
-    <conf defaultResolver="test"
+    <conf defaultCache="build/cache"
+          defaultResolver="test"
           defaultConflictManager="regexp"
             />
 

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml?view=diff&rev=515980&r1=515979&r2=515980
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml
Thu Mar  8 01:17:54 2007
@@ -1,6 +1,7 @@
 <ivyconf>
 
-  <conf defaultResolver="test"
+  <conf defaultCache="build/cache"
+        defaultResolver="test"
         defaultConflictManager="strict"
   />
   



Mime
View raw message