ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1097631 - /ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
Date Thu, 28 Apr 2011 21:51:31 GMT
Author: hibou
Date: Thu Apr 28 21:51:30 2011
New Revision: 1097631

URL: http://svn.apache.org/viewvc?rev=1097631&view=rev
Log:
fix the tests regarding the previous commit r1097628

Modified:
    ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java?rev=1097631&r1=1097630&r2=1097631&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
Thu Apr 28 21:51:30 2011
@@ -17,26 +17,45 @@
  */
 package org.apache.ivy.osgi.updatesite;
 
+import java.io.File;
 import java.io.IOException;
 import java.text.ParseException;
 import java.util.Iterator;
 
 import junit.framework.TestCase;
 
+import org.apache.ivy.core.cache.CacheResourceOptions;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.osgi.repo.RepoDescriptor;
+import org.apache.ivy.util.CacheCleaner;
 import org.xml.sax.SAXException;
 
 public class UpdateSiteLoaderTest extends TestCase {
 
+    private UpdateSiteLoader loader;
+
+    private File cache;
+
+    protected void setUp() throws Exception {
+        IvySettings ivySettings = new IvySettings();
+        cache = new File("build/cache");
+        cache.mkdirs();
+        ivySettings.setDefaultCache(cache);
+        CacheResourceOptions options = new CacheResourceOptions();
+        loader = new UpdateSiteLoader(ivySettings.getDefaultRepositoryCacheManager(), null,
options);
+    }
+
+    protected void tearDown() throws Exception {
+        CacheCleaner.deleteDir(cache);
+    }
+
     public void testIvyDE() throws IOException, ParseException, SAXException {
-        UpdateSiteLoader loader = new UpdateSiteLoader();
         RepoDescriptor site = loader.load("http://www.apache.org/dist/ant/ivyde/updatesite/");
         assertEquals(13, site.getModules().size());
     }
 
     public void testM2Eclipse() throws IOException, ParseException, SAXException {
-        UpdateSiteLoader loader = new UpdateSiteLoader();
         RepoDescriptor site = loader.load("http://m2eclipse.sonatype.org/sites/m2e/");
         assertTrue(site.getModules().size() > 70);
         Iterator itModules = site.getModules().iterator();
@@ -45,10 +64,12 @@ public class UpdateSiteLoaderTest extend
             String name = md.getModuleRevisionId().getName();
             assertTrue(name, name.indexOf("org.maven") != -1);
         }
+
+        site = loader.load("http://m2eclipse.sonatype.org/sites/m2e/");
+        assertTrue(site.getModules().size() > 70);
     }
 
     public void _disabled_testHeliosEclipse() throws IOException, ParseException, SAXException
{
-        UpdateSiteLoader loader = new UpdateSiteLoader();
         RepoDescriptor site = loader.load("http://download.eclipse.org/releases/helios/");
         assertTrue(site.getModules().size() > 900);
     }



Mime
View raw message