Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 57726 invoked from network); 10 Oct 2008 15:35:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Oct 2008 15:35:04 -0000 Received: (qmail 54506 invoked by uid 500); 10 Oct 2008 15:35:03 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 54496 invoked by uid 500); 10 Oct 2008 15:35:03 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 54487 invoked by uid 99); 10 Oct 2008 15:35:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 08:35:03 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE 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; Fri, 10 Oct 2008 15:34:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 552602388961; Fri, 10 Oct 2008 08:34:13 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r703499 - /geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java Date: Fri, 10 Oct 2008 15:34:13 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081010153413.552602388961@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Fri Oct 10 08:34:12 2008 New Revision: 703499 URL: http://svn.apache.org/viewvc?rev=703499&view=rev Log: Add similar test to gshell-artifact to help test how fast/slow it is Modified: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java Modified: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java?rev=703499&r1=703498&r2=703499&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java (original) +++ geronimo/gshell/trunk/gshell-support/gshell-artifact/src/test/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactoryTest.java Fri Oct 10 08:34:12 2008 @@ -20,6 +20,16 @@ package org.apache.geronimo.gshell.artifact; import org.apache.geronimo.gshell.spring.SpringTestSupport; +import org.apache.geronimo.gshell.chronos.StopWatch; +import org.apache.maven.artifact.resolver.ArtifactResolutionResult; +import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; +import org.apache.maven.artifact.Artifact; + +import java.util.List; +import java.util.ArrayList; +import java.util.Set; +import java.util.LinkedHashSet; +import java.io.File; /** * Unit tests for the {@link ArtifactManagerFactory} class. @@ -29,8 +39,26 @@ public class ArtifactManagerFactoryTest extends SpringTestSupport { + /* public void testProcessor() throws Exception { ArtifactManager artifactManager = getBeanContainer().getBean("artifactManager", ArtifactManager.class); assertNotNull(artifactManager); } + */ + + public void testResolve() throws Exception { + ArtifactManager artifactManager = getBean(ArtifactManager.class); + artifactManager.getRepositoryManager().setLocalRepository(new File("/tmp/repo")); + artifactManager.getRepositoryManager().addRemoteRepository("local-cache", new File("/Users/jason/.m2/repository").toURI()); + + ArtifactResolutionRequest request = new ArtifactResolutionRequest(); + Set deps = new LinkedHashSet(); + deps.add(artifactManager.getArtifactFactory().createArtifact("org.apache.geronimo.gshell.wisdom", "gshell-wisdom-bootstrap", "1.0-alpha-2-SNAPSHOT", Artifact.SCOPE_RUNTIME, "jar")); + request.setArtifactDependencies(deps); + + StopWatch watch = new StopWatch(true); + + ArtifactResolutionResult result = artifactManager.resolve(request); + log.debug("Resolution completed in: {}", watch); + } } \ No newline at end of file