Author: hibou
Date: Tue Jul 23 15:22:45 2013
New Revision: 1506108

URL: http://svn.apache.org/r1506108
Log:
- fix the module set gathering
- fix the tests on the online repos

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

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java?rev=1506108&r1=1506107&r2=1506108&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java 
Tue Jul 23 15:22:45 2013
@@ -18,12 +18,10 @@
 package org.apache.ivy.osgi.repo;
 
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -36,7 +34,7 @@ public class RepoDescriptor {
 
     private final Map/* <String, Map<String, Set<ModuleDescriptor>>> 
*/moduleByCapabilities = new HashMap();
 
-    private final List/* <ModuleDescriptor> */modules = new ArrayList();
+    private final Set/* <ModuleDescriptor> */modules = new HashSet();
 
     private final ExecutionEnvironmentProfileProvider profileProvider;
 

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=1506108&r1=1506107&r2=1506108&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
 Tue Jul 23 15:22:45 2013
@@ -57,7 +57,7 @@ public class UpdateSiteLoaderTest extend
     public void testIvyDE() throws IOException, ParseException, SAXException, 
URISyntaxException {
         RepoDescriptor site = loader.load(new URI(
                 "http://www.apache.org/dist/ant/ivyde/updatesite/";));
-        assertFalse(site.getModules().hasNext());
+        assertTrue(site.getModules().hasNext());
         for (Iterator it = site.getModules(); it.hasNext();) {
             ModuleDescriptor md = ((ModuleDescriptorWrapper) 
it.next()).getModuleDescriptor();
             String name = md.getModuleRevisionId().getName();
@@ -67,15 +67,9 @@ public class UpdateSiteLoaderTest extend
 
     public void testM2Eclipse() throws IOException, ParseException, 
SAXException,
             URISyntaxException {
-        RepoDescriptor site = loader.load(new 
URI("http://m2eclipse.sonatype.org/sites/m2e/";));
-        assertTrue(CollectionUtils.toList(site.getModules()).size() > 50);
-        Iterator itModules = site.getModules();
-        while (itModules.hasNext()) {
-            ModuleDescriptor md = ((ModuleDescriptorWrapper) itModules.next())
-                    .getModuleDescriptor();
-            String name = md.getModuleRevisionId().getName();
-            assertTrue(name, name.indexOf("org.maven") != -1);
-        }
+        RepoDescriptor site = loader.load(new URI(
+                "http://download.eclipse.org/technology/m2e/releases/";));
+        assertTrue(CollectionUtils.toList(site.getModules()).size() > 20);
     }
 
     public void _disabled_testHeliosEclipse() throws IOException, 
ParseException, SAXException,


Reply via email to