Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E629010B6F for ; Sun, 5 Jan 2014 10:38:38 +0000 (UTC) Received: (qmail 46636 invoked by uid 500); 5 Jan 2014 10:38:38 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 46610 invoked by uid 500); 5 Jan 2014 10:38:38 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 46603 invoked by uid 99); 5 Jan 2014 10:38:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jan 2014 10:38:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jan 2014 10:38:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CDC1D23889CB for ; Sun, 5 Jan 2014 10:38:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: notifications@ant.apache.org From: hibou@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140105103816.CDC1D23889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 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/**/ getProblems(); - public abstract List/**/ getWarns(); - public abstract List/**/ getErrors(); + public abstract List getProblems(); + public abstract List getWarns(); + public abstract List 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 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); } } }