geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
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 GMT
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<Artifact> deps = new LinkedHashSet<Artifact>();
+        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



Mime
View raw message