incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r508504 [3/3] - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/check/ src/java/org/apache/ivy/core/install/ src/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/cor...
Date Fri, 16 Feb 2007 17:28:13 GMT
Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java?view=diff&rev=508504&r1=508503&r2=508504
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
Fri Feb 16 09:28:12 2007
@@ -37,6 +37,7 @@
 import org.apache.ivy.core.resolve.DownloadOptions;
 import org.apache.ivy.core.resolve.ResolveData;
 import org.apache.ivy.core.resolve.ResolveEngine;
+import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
@@ -72,7 +73,7 @@
     	_settings = new IvySettings();
         _engine = new ResolveEngine(_settings, new EventManager(), new SortEngine(_settings));
         _cache = new File("build/cache");
-        _data = new ResolveData(_engine, _cache, null, null, true);
+        _data = new ResolveData(_engine, new ResolveOptions().setCache(CacheManager.getInstance(_settings,
_cache)));
         _cache.mkdirs();
         _cacheManager = new CacheManager(_settings, _cache);
         _settings.setDefaultCache(_cache);

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IBiblioResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IBiblioResolverTest.java?view=diff&rev=508504&r1=508503&r2=508504
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IBiblioResolverTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IBiblioResolverTest.java
Fri Feb 16 09:28:12 2007
@@ -35,6 +35,7 @@
 import org.apache.ivy.core.resolve.DownloadOptions;
 import org.apache.ivy.core.resolve.ResolveData;
 import org.apache.ivy.core.resolve.ResolveEngine;
+import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.core.sort.SortEngine;
@@ -53,16 +54,14 @@
     private ResolveEngine _engine;
     private ResolveData _data;
     private File _cache;
-	private CacheManager _cacheManager;
     
     
     protected void setUp() throws Exception {
     	_settings = new IvySettings();
         _engine = new ResolveEngine(_settings, new EventManager(), new SortEngine(_settings));
         _cache = new File("build/cache");
-        _data = new ResolveData(_engine, _cache, null, null, true);
+        _data = new ResolveData(_engine, new ResolveOptions().setCache(CacheManager.getInstance(_settings,
_cache)));
         _cache.mkdirs();
-        _cacheManager = new CacheManager(_settings, _cache);
         _settings.setDefaultCache(_cache);
     }
     

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IvyRepResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IvyRepResolverTest.java?view=diff&rev=508504&r1=508503&r2=508504
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IvyRepResolverTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/IvyRepResolverTest.java
Fri Feb 16 09:28:12 2007
@@ -34,6 +34,7 @@
 import org.apache.ivy.core.resolve.DownloadOptions;
 import org.apache.ivy.core.resolve.ResolveData;
 import org.apache.ivy.core.resolve.ResolveEngine;
+import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
@@ -54,16 +55,14 @@
     private ResolveEngine _engine;
     private ResolveData _data;
     private File _cache;
-	private CacheManager _cacheManager;
     
     
     protected void setUp() throws Exception {
     	_settings = new IvySettings();
         _engine = new ResolveEngine(_settings, new EventManager(), new SortEngine(_settings));
         _cache = new File("build/cache");
-        _data = new ResolveData(_engine, _cache, null, null, true);
+        _data = new ResolveData(_engine, new ResolveOptions().setCache(CacheManager.getInstance(_settings,
_cache)));
         _cache.mkdirs();
-        _cacheManager = new CacheManager(_settings, _cache);
         _settings.setDefaultCache(_cache);
     }
     

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java?view=diff&rev=508504&r1=508503&r2=508504
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java
Fri Feb 16 09:28:12 2007
@@ -36,6 +36,7 @@
 import org.apache.ivy.core.resolve.DownloadOptions;
 import org.apache.ivy.core.resolve.ResolveData;
 import org.apache.ivy.core.resolve.ResolveEngine;
+import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.core.sort.SortEngine;
@@ -50,21 +51,19 @@
  */
 public class URLResolverTest extends TestCase {
 	// remote.test
-    private IvySettings _ivy;
+    private IvySettings _settings;
     private ResolveEngine _engine;
     private ResolveData _data;
     private File _cache;
-	private CacheManager _cacheManager;
     
     
     protected void setUp() throws Exception {
-    	_ivy = new IvySettings();
-        _engine = new ResolveEngine(_ivy, new EventManager(), new SortEngine(_ivy));
+    	_settings = new IvySettings();
+        _engine = new ResolveEngine(_settings, new EventManager(), new SortEngine(_settings));
         _cache = new File("build/cache");
-        _data = new ResolveData(_engine, _cache, null, null, true);
+        _data = new ResolveData(_engine, new ResolveOptions().setCache(CacheManager.getInstance(_settings,
_cache)));
         _cache.mkdirs();
-        _cacheManager = new CacheManager(_ivy, _cache);
-        _ivy.setDefaultCache(_cache);
+        _settings.setDefaultCache(_cache);
     }
     
     protected void tearDown() throws Exception {
@@ -76,7 +75,7 @@
     
     public void testFile() throws Exception {
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         String rootpath = new File("test/repositories/1").getAbsolutePath();
         resolver.addIvyPattern("file:"+rootpath + "/[organisation]/[module]/ivys/ivy-[revision].xml");
         resolver.addArtifactPattern("file:"+rootpath + "/[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
@@ -94,7 +93,7 @@
         
         // test to ask to download
         DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
-        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_ivy,
_cache));
+        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings,
_cache));
         assertNotNull(report);
         
         assertEquals(1, report.getArtifactsReports().length);
@@ -106,7 +105,7 @@
         assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());
 
         // test to ask to download again, should use cache
-        report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_ivy, _cache));
+        report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings,
_cache));
         assertNotNull(report);
         
         assertEquals(1, report.getArtifactsReports().length);
@@ -120,7 +119,7 @@
 
     public void testLatestFile() throws Exception {
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         String rootpath = new File("test/repositories/1").getAbsolutePath().replaceAll("\\\\",
"/");
         resolver.addIvyPattern("file:"+rootpath + "/[organisation]/[module]/ivys/ivy-[revision].xml");
         resolver.addArtifactPattern("file:"+rootpath + "/[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
@@ -143,7 +142,7 @@
         }
         
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         resolver.addArtifactPattern(ibiblioRoot+"/[module]/[type]s/[artifact]-[revision].[type]");
         resolver.setName("test");
         assertEquals("test", resolver.getName());
@@ -154,7 +153,7 @@
         assertEquals(mrid, rmr.getId());
 
         DefaultArtifact artifact = new DefaultArtifact(mrid, rmr.getPublicationDate(), "commons-fileupload",
"jar", "jar");
-        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_ivy,
_cache));
+        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings,
_cache));
         assertNotNull(report);
         
         assertEquals(1, report.getArtifactsReports().length);
@@ -166,7 +165,7 @@
         assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());
 
         // test to ask to download again, should use cache
-        report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_ivy, _cache));
+        report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings,
_cache));
         assertNotNull(report);
         
         assertEquals(1, report.getArtifactsReports().length);
@@ -185,7 +184,7 @@
         }
         
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         resolver.addArtifactPattern(ibiblioRoot+"/[module]/[type]s/[artifact]-[revision].[type]");
         resolver.setName("test");
         assertEquals("test", resolver.getName());
@@ -200,7 +199,7 @@
 
         DefaultArtifact profiler = new DefaultArtifact(mrid, rmr.getPublicationDate(), "nanning-profiler",
"jar", "jar");
         DefaultArtifact trace = new DefaultArtifact(mrid, rmr.getPublicationDate(), "nanning-trace",
"jar", "jar");
-        DownloadReport report = resolver.download(new Artifact[] {profiler, trace}, new DownloadOptions(_ivy,
_cache));
+        DownloadReport report = resolver.download(new Artifact[] {profiler, trace}, new DownloadOptions(_settings,
_cache));
         assertNotNull(report);
         
         assertEquals(2, report.getArtifactsReports().length);
@@ -218,7 +217,7 @@
         assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());
 
         // test to ask to download again, should use cache
-        report = resolver.download(new Artifact[] {profiler, trace}, new DownloadOptions(_ivy,
_cache));
+        report = resolver.download(new Artifact[] {profiler, trace}, new DownloadOptions(_settings,
_cache));
         assertNotNull(report);
         
         assertEquals(2, report.getArtifactsReports().length);
@@ -243,7 +242,7 @@
         }
         
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         resolver.addArtifactPattern(ibiblioRoot+"/[module]/[type]s/[artifact]-[revision].[type]");
         resolver.setName("test");
         assertEquals("test", resolver.getName());
@@ -261,7 +260,7 @@
         }
         
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         resolver.addIvyPattern(ibiblioRoot+"/[module]/ivys/ivy-[revision].xml");
         resolver.addArtifactPattern(ibiblioRoot+"/maven/[module]/[type]s/[artifact]-[revision].[type]");
         resolver.setName("test");
@@ -271,7 +270,7 @@
 
     public void testDownloadWithUseOriginIsTrue() throws Exception {
         URLResolver resolver = new URLResolver();
-        resolver.setSettings(_ivy);
+        resolver.setSettings(_settings);
         String rootpath = new File("test/repositories/1").getAbsolutePath();
         resolver.addIvyPattern("file:"+rootpath + "/[organisation]/[module]/ivys/ivy-[revision].xml");
         resolver.addArtifactPattern("file:"+rootpath + "/[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
@@ -289,7 +288,7 @@
         
         // test to ask to download
         DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
-        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_ivy,
new CacheManager(_ivy, _cache), null, true));
+        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(_settings,
new CacheManager(_settings, _cache), null, true));
         assertNotNull(report);
         
         assertEquals(1, report.getArtifactsReports().length);



Mime
View raw message