You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2006/04/16 08:35:13 UTC

svn commit: r394439 [3/3] - in /geronimo/branches/1.1: ./ applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/car/ applications/console-standard/src/webapp/WEB-INF/view...

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/AbstractRepositoryTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/AbstractRepositoryTest.java?rev=394439&r1=394438&r2=394439&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/AbstractRepositoryTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/AbstractRepositoryTest.java Sat Apr 15 23:35:09 2006
@@ -24,6 +24,7 @@
 import junit.framework.TestCase;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.repository.Version;
 
 /**
  * @version $Rev$ $Date$
@@ -32,19 +33,118 @@
     protected ListableRepository repository;
     protected File rootRepoDir;
 
+    protected void setUp() throws Exception {
+        super.setUp();
+        // Don't want .svn dirs messing up my count!
+        deleteSVN(rootRepoDir);
+    }
+
+    private void deleteSVN(File dir) {
+        if(!dir.isDirectory() || !dir.canRead()) {
+            throw new IllegalStateException("Invalid dir "+dir.getAbsolutePath());
+        }
+        File[] children = dir.listFiles();
+        for (int i = 0; i < children.length; i++) {
+            File child = children[i];
+            if(child.isDirectory()) {
+                if(child.getName().equals(".svn")) {
+                    recursiveDelete(child);
+                } else {
+                    deleteSVN(child);
+                }
+            }
+        }
+    }
+
+    private void recursiveDelete(File dir) {
+        if(!dir.isDirectory() || !dir.canRead()) {
+            throw new IllegalStateException("Invalid dir "+dir.getAbsolutePath());
+        }
+        File[] children = dir.listFiles();
+        for (int i = 0; i < children.length; i++) {
+            File child = children[i];
+            if(child.isDirectory()) {
+                recursiveDelete(child);
+            } else {
+                if(!child.delete()) {
+                    throw new IllegalStateException("Cannot delete "+child.getAbsolutePath());
+                }
+            }
+        }
+        if(!dir.delete()) {
+            throw new IllegalStateException("Cannot delete "+dir.getAbsolutePath());
+        }
+    }
+
     public void testListAll() {
         SortedSet artifacts = repository.list();
+        System.out.println("Matched artifacts: "+artifacts);
 
         assertTrue(artifacts.contains(new Artifact("org.foo", "test", "2.0.1", "properties")));
         assertFalse(artifacts.contains(new Artifact("Unknown", "artifact", "2.0.1", "properties")));
+        assertEquals(4, artifacts.size());
+    }
+
+    public void testListSpecifyArtifact() {
+        SortedSet artifacts = repository.list(new Artifact(null, "test", (Version)null, null));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.3", "properties")));
+        assertTrue(artifacts.contains(new Artifact("org.foo", "test", "2.0.1", "properties")));
+        assertEquals(3, artifacts.size());
+    }
+
+    public void testListSpecifyArtifactGroup() {
+        SortedSet artifacts = repository.list(new Artifact("org.bar", "test", (Version)null, null));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.3", "properties")));
+        assertEquals(2, artifacts.size());
+    }
+
+    public void testListSpecifyArtifactType() {
+        SortedSet artifacts = repository.list(new Artifact(null, "test", (Version)null, "properties"));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.3", "properties")));
+        assertTrue(artifacts.contains(new Artifact("org.foo", "test", "2.0.1", "properties")));
+        assertEquals(3, artifacts.size());
+    }
+
+    public void testListSpecifyArtifactVersion() {
+        SortedSet artifacts = repository.list(new Artifact(null, "test", "1.5", null));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertEquals(1, artifacts.size());
     }
 
-    public void testListVersions() {
-        SortedSet artifacts = repository.list("org.bar", "test", "properties");
+    public void testListSpecifyArtifactGroupType() {
+        SortedSet artifacts = repository.list(new Artifact("org.bar", "test", (Version)null, "properties"));
 
         assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
         assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.3", "properties")));
         assertEquals(2, artifacts.size());
+    }
+
+    public void testListSpecifyArtifactGroupVersion() {
+        SortedSet artifacts = repository.list(new Artifact("org.bar", "test", "1.5", null));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertEquals(1, artifacts.size());
+    }
+
+    public void testListSpecifyArtifactVersionType() {
+        SortedSet artifacts = repository.list(new Artifact(null, "test", "1.5", "properties"));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertEquals(1, artifacts.size());
+    }
+
+    public void testListSpecifyAll() {
+        SortedSet artifacts = repository.list(new Artifact("org.bar", "test", "1.5", "properties"));
+
+        assertTrue(artifacts.contains(new Artifact("org.bar", "test", "1.5", "properties")));
+        assertEquals(1, artifacts.size());
     }
 
     public void testLocation() throws Exception {

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven1RepositoryTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven1RepositoryTest.java?rev=394439&r1=394438&r2=394439&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven1RepositoryTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven1RepositoryTest.java Sat Apr 15 23:35:09 2006
@@ -23,8 +23,8 @@
  */
 public class Maven1RepositoryTest extends AbstractRepositoryTest {
     protected void setUp() throws Exception {
-        super.setUp();
-        rootRepoDir = new File("src/test-repo/m1");
+        rootRepoDir = new File("target/m1");
         repository = new Maven1Repository(rootRepoDir);
+        super.setUp();
     }
 }

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven2RepositoryTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven2RepositoryTest.java?rev=394439&r1=394438&r2=394439&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven2RepositoryTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/repository/Maven2RepositoryTest.java Sat Apr 15 23:35:09 2006
@@ -23,8 +23,8 @@
  */
 public class Maven2RepositoryTest extends AbstractRepositoryTest {
     protected void setUp() throws Exception {
-        super.setUp();
-        rootRepoDir = new File("src/test-repo/m2");
+        rootRepoDir = new File("target/m2");
         repository = new Maven2Repository(rootRepoDir);
+        super.setUp();
     }
 }

Modified: geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java?rev=394439&r1=394438&r2=394439&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java (original)
+++ geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java Sat Apr 15 23:35:09 2006
@@ -41,7 +41,7 @@
 import java.util.LinkedHashSet;
 
 /**
- * @version $Rev: 384686 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class BaseConfigInstaller {
     public static final FileWriteMonitor LOG_COPY_START = new StartFileWriteMonitor();
@@ -194,7 +194,7 @@
             // Determine the dependencies of this artifact
             dependencies = sourceRepo.getDependencies(configId);
         }
-        dependencies = artifactResolver.resolve(dependencies);
+        dependencies = artifactResolver.resolveInClassLoader(dependencies);
         for (Iterator iterator = dependencies.iterator(); iterator.hasNext();) {
             Artifact artifact = (Artifact) iterator.next();
             execute(artifact);