ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1555477 - in /ant/ivy/core/trunk: src/java/org/apache/ivy/util/Message.java src/java/org/apache/ivy/util/MessageLogger.java test/java/org/apache/ivy/osgi/obr/OBRParserTest.java
Date Sun, 05 Jan 2014 10:38:16 GMT
Author: hibou
Date: Sun Jan  5 10:38:16 2014
New Revision: 1555477

URL: http://svn.apache.org/r1555477
Log:
embrace java 5

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/Message.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/MessageLogger.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/obr/OBRParserTest.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/Message.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/Message.java?rev=1555477&r1=1555476&r2=1555477&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/Message.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/Message.java Sun Jan  5 10:38:16 2014
@@ -135,7 +135,7 @@ public final class Message {
         }
     }
 
-    public static List getProblems() {
+    public static List<String> getProblems() {
         return getLogger().getProblems();
     }
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/MessageLogger.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/MessageLogger.java?rev=1555477&r1=1555476&r2=1555477&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/MessageLogger.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/MessageLogger.java Sun Jan  5 10:38:16
2014
@@ -79,9 +79,9 @@ public interface MessageLogger {
 
     public abstract void error(String msg);
 
-    public abstract List/*<String>*/ getProblems();
-    public abstract List/*<String>*/ getWarns();
-    public abstract List/*<String>*/ getErrors();
+    public abstract List<String> getProblems();
+    public abstract List<String> getWarns();
+    public abstract List<String> getErrors();
 
     /**
      * Clears the list of problems, warns and errors.

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/obr/OBRParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/obr/OBRParserTest.java?rev=1555477&r1=1555476&r2=1555477&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/obr/OBRParserTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/obr/OBRParserTest.java Sun Jan  5 10:38:16
2014
@@ -28,7 +28,6 @@ import org.apache.ivy.osgi.obr.xml.OBRXM
 import org.apache.ivy.osgi.repo.BundleRepoDescriptor;
 import org.apache.ivy.osgi.repo.ModuleDescriptorWrapper;
 import org.apache.ivy.util.CollectionUtils;
-import org.apache.ivy.util.Message;
 
 public class OBRParserTest extends TestCase {
 
@@ -38,13 +37,6 @@ public class OBRParserTest extends TestC
         BundleRepoDescriptor repo = OBRXMLParser.parse(testObr.toURI(), new FileInputStream(
                 new File(testObr, "obr.xml")));
         assertNotNull(repo);
-        System.out.println(CollectionUtils.toList(repo.getModules()).size() + " bundles successfully
parsed, "
-                + Message.getProblems().size() + " errors");
-        Iterator itPb = Message.getProblems().iterator();
-        while (itPb.hasNext()) {
-            Object error = itPb.next();
-            System.err.println(error);
-        }
         assertEquals("OBR/Releases", repo.getName());
         assertEquals("1253581430652", repo.getLastModified());
     }
@@ -54,26 +46,32 @@ public class OBRParserTest extends TestC
                 new File(testObr, "sources.xml")));
         assertNotNull(repo);
         assertEquals(2, CollectionUtils.toList(repo.getModules()).size());
-        Iterator itModule = repo.getModules();
+        Iterator<ModuleDescriptorWrapper> itModule = repo.getModules();
         while (itModule.hasNext()) {
-            ModuleDescriptor md = ((ModuleDescriptorWrapper) itModule.next()).getModuleDescriptor();
+            ModuleDescriptor md = itModule.next().getModuleDescriptor();
             if (md.getModuleRevisionId().getName().equals("org.apache.felix.eventadmin"))
{
                 assertEquals(1, md.getAllArtifacts().length);
             } else {
                 assertEquals("org.apache.felix.bundlerepository", md.getModuleRevisionId()
                         .getName());
                 assertEquals(2, md.getAllArtifacts().length);
+                String type0 = md.getAllArtifacts()[0].getType();
                 String url0 = md.getAllArtifacts()[0].getUrl().toExternalForm();
+                String type1 = md.getAllArtifacts()[1].getType();
                 String url1 = md.getAllArtifacts()[1].getUrl().toExternalForm();
                 String jarUrl = "http://repo1.maven.org/maven2/org/apache/felix/"
                         + "org.apache.felix.bundlerepository/1.0.3/org.apache.felix.bundlerepository-1.0.3.jar";
                 String srcUrl = "http://oscar-osgi.sf.net/obr2/org.apache.felix.bundlerepository/"
                         + "org.apache.felix.bundlerepository-1.0.3-src.jar";
-                if (url0.equals(srcUrl)) {
-                    assertEquals(jarUrl, url1);
-                } else {
+                if (type0.equals("jar")) {
                     assertEquals(jarUrl, url0);
+                    assertEquals("source", type1);
                     assertEquals(srcUrl, url1);
+                } else {
+                    assertEquals("jar", type1);
+                    assertEquals(jarUrl, url1);
+                    assertEquals("source", type0);
+                    assertEquals(srcUrl, url0);
                 }
             }
         }



Mime
View raw message