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 xa...@apache.org on 2007/03/07 16:44:10 UTC

svn commit: r515638 - /incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java

Author: xavier
Date: Wed Mar  7 08:44:02 2007
New Revision: 515638

URL: http://svn.apache.org/viewvc?view=rev&rev=515638
Log:
FIX: bad timestamps were causing tests with latest-time to fail for IVY-407

Modified:
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java

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=515638&r1=515637&r2=515638
==============================================================================
--- 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 Wed Mar  7 08:44:02 2007
@@ -89,6 +89,14 @@
 		ivy = new Ivy();
 		ivy.configure(LatestConflictManagerTest.class
 				.getResource("ivyconf-latest-time.xml"));
+    	ivy.getSettings().setVariable("ivy.log.conflict.resolution", "true", true);
+
+    	// set timestamps, because svn is not preserving this information, 
+    	// and the latest time strategy is relying on it
+    	long time = System.currentTimeMillis() - 10000;
+    	new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar").setLastModified(time);
+    	new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.2.jar").setLastModified(time+2000);
+
         ResolveReport report =
             ivy.resolve( LatestConflictManagerTest.class.getResource( "ivy-latest-time-1.xml" ), 
             		getResolveOptions() );
@@ -110,6 +118,14 @@
 		ivy = new Ivy();
 		ivy.configure(LatestConflictManagerTest.class
 				.getResource("ivyconf-latest-time.xml"));
+    	ivy.getSettings().setVariable("ivy.log.conflict.resolution", "true", true);
+
+    	// set timestamps, because svn is not preserving this information, 
+    	// and the latest time strategy is relying on it
+    	long time = System.currentTimeMillis() - 10000;
+    	new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar").setLastModified(time);
+    	new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.2.jar").setLastModified(time+2000);
+
         ResolveReport report =
             ivy.resolve( LatestConflictManagerTest.class.getResource( "ivy-latest-time-2.xml" ), 
             		getResolveOptions() );