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 208713FE1 for ; Thu, 28 Apr 2011 21:51:53 +0000 (UTC) Received: (qmail 21884 invoked by uid 500); 28 Apr 2011 21:51:52 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 21786 invoked by uid 500); 28 Apr 2011 21:51:52 -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 21616 invoked by uid 99); 28 Apr 2011 21:51:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 21:51:52 +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; Thu, 28 Apr 2011 21:51:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4366B2388B45; Thu, 28 Apr 2011 21:51:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: notifications@ant.apache.org From: hibou@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110428215131.4366B2388B45@eris.apache.org> 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); }