geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r424668 - in /geronimo/sandbox/svkmerge/geronimo-repository: ./ geronimo-repository-api/ geronimo-repository-api/src/ geronimo-repository-api/src/main/ geronimo-repository-api/src/main/java/ geronimo-repository-api/src/main/java/org/ geroni...
Date Sun, 23 Jul 2006 03:02:07 GMT
Author: jdillon
Date: Sat Jul 22 20:02:05 2006
New Revision: 424668

URL: http://svn.apache.org/viewvc?rev=424668&view=rev
Log:
Skeletal experiment to implement a Geronimo repository w/JDBM
Also provides a common m2 structure for a subsystem and its extensions

Added:
    geronimo/sandbox/svkmerge/geronimo-repository/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml   (with
props)
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/main/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/main/java/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/main/java/org/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/main/java/org/apache/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/main/java/org/apache/geronimo/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/main/java/org/apache/geronimo/repository/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/test/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/test/java/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/test/java/org/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/test/java/org/apache/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/test/java/org/apache/geronimo/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/src/test/java/org/apache/geronimo/repository/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
  (with props)
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
  (with props)
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
  (with props)
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
  (with props)
    geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml  
(with props)
    geronimo/sandbox/svkmerge/geronimo-repository/pom.xml   (with props)

Added: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml (added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml Sat Jul
22 20:02:05 2006
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-repository</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <artifactId>geronimo-repository-api</artifactId>
+    <name>Geronimo Repository :: API</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${pom.version}</version>
+            <type>jar</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${pom.version}</version>
+            <type>jar</type>
+        </dependency>
+    </dependencies>
+    
+</project>
+

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-api/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
(added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
Sat Jul 22 20:02:05 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-repository-providers</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <artifactId>geronimo-repository-jdbm</artifactId>
+    <name>Geronimo Repository Providers :: JDBM</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>jdbm</groupId>
+            <artifactId>jdbm</artifactId>
+            <version>1.0</version>
+            <type>jar</type>
+        </dependency>
+    </dependencies>
+    
+</project>

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
(added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
Sat Jul 22 20:02:05 2006
@@ -0,0 +1,59 @@
+/**
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.repository.jdbm;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ * Provides a database of {@link Artifact} objects.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ArtifactDatabase
+{
+    private static final Log log = LogFactory.getLog(ArtifactDatabase.class);
+
+    private File baseDir;
+
+    public ArtifactDatabase(final File baseDir) throws IOException {
+        if (baseDir == null) {
+            throw new IllegalArgumentException("Basedir is null");
+        }
+
+        //
+        // TODO: Sanity check baseDir
+        //
+
+        this.baseDir = baseDir;
+    }
+
+    public File getBaseDir() {
+        return baseDir;
+    }
+
+    public void close() {
+        //
+        // TODO:
+        //
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/ArtifactDatabase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
(added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
Sat Jul 22 20:02:05 2006
@@ -0,0 +1,162 @@
+/**
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.repository.jdbm;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.IOException;
+
+import java.net.URI;
+import java.util.SortedSet;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+
+import org.apache.geronimo.system.repository.AbstractRepository;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+
+/**
+ * Geronimo repository implemenation backed by <a href="http://jdbm.sourceforge.net">JDBM</a>.
+ *
+ * @version $Rev$ $Date$
+ */
+public class JdbmRepository
+    extends AbstractRepository
+    implements WritableListableRepository
+{
+    private ArtifactDatabase db;
+
+    private File dataDir;
+
+    public JdbmRepository(final URI root, final ServerInfo serverInfo) {
+        super(root, serverInfo);
+    }
+
+    public JdbmRepository(final File root) throws IOException {
+        super(root);
+
+        this.db = new ArtifactDatabase(root);
+        this.dataDir = new File(root, "data");
+    }
+
+    private void ensureFullyResolved(final Artifact artifact) {
+        assert artifact != null;
+
+        if (!artifact.isResolved()) {
+            throw new IllegalArgumentException("Artifact is not fully resolved: " + artifact);
+        }
+    }
+
+    //
+    // Repository
+    //
+    
+    public File getLocation(final Artifact artifact) {
+        assert artifact != null;
+        
+        ensureFullyResolved(artifact);
+
+        Artifact base = new Artifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
null);
+
+        // Use a shorten but unique path that includes the filename for clarity
+        //    <g+a+v_hash>/<artifact>-<version>.<type>
+
+        File dir = new File(this.dataDir, String.valueOf(base.hashCode()));
+        return new File(dir, artifact.getArtifactId() + "-" + artifact.getVersion() + "."
+ artifact.getType());
+    }
+
+    public boolean contains(final Artifact artifact) {
+        assert artifact != null;
+
+        ensureFullyResolved(artifact);
+
+        //
+        // TODO: Query the DB to get the status of the artifact
+        //
+
+        return false;
+    }
+
+    //
+    // WritableRepository
+    //
+    
+    public void copyToRepository(final InputStream source, final int size, final Artifact
destination, final FileWriteMonitor monitor) throws IOException {
+        assert source != null;
+        assert size > 0;
+        assert destination != null;
+        assert monitor != null;
+
+        ensureFullyResolved(destination);
+        
+        //
+        // TODO: Copy... maybe able to re-use super-class impl... check
+        //
+
+        //
+        // TODO: Insert into DB
+        //
+    }
+    
+    //
+    // ListableRepository
+    //
+    
+    public SortedSet list(final Artifact query) {
+        assert query != null;
+
+        //
+        // TODO: Query the DB
+        //
+
+        return null;
+    }
+    
+    public SortedSet list() {
+
+        //
+        // TODO: List all artifacts from the DB
+        //
+
+        return null;
+    }
+    
+    //
+    // GBean
+    //
+    
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(JdbmRepository.class, "Repository");
+        
+        builder.addAttribute("root", URI.class, true);
+        builder.addReference("ServerInfo", ServerInfo.class, "GBean");
+        builder.addInterface(JdbmRepository.class);
+        builder.setConstructor(new String[]{ "root", "ServerInfo" });
+        
+        GBEAN_INFO = builder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/main/java/org/apache/geronimo/repository/jdbm/JdbmRepository.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
(added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
Sat Jul 22 20:02:05 2006
@@ -0,0 +1,69 @@
+/**
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.repository.jdbm;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.repository.jdbm.JdbmRepository;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Unit tests for the {@link JdbmRepository} class.
+ *
+ * @version $Rev$ $Date$
+ */
+public class JdbmRepositoryTest
+    extends TestCase
+{
+    private static final Log log = LogFactory.getLog(JdbmRepositoryTest.class);
+    
+    private File basedir = new File(new File(System.getProperty("basedir")), "target");
+
+    public void testInitializeEmpty() throws Exception {
+        File root = new File(basedir, "repo1");
+        root.mkdirs();
+        JdbmRepository repo = new JdbmRepository(root);
+    }
+    
+    public void testNotSuchRoot() throws Exception {
+        File root = new File(basedir, "repo-never-exists");
+        try {
+            JdbmRepository repo = new JdbmRepository(root);
+            fail("Initialized with missing directory");
+        }
+        catch (IllegalStateException expected) {
+            // ignore
+        }
+    }
+
+    public void testGetLocation() throws Exception {
+        File root = new File(basedir, "repo1");
+        root.mkdirs();
+        JdbmRepository repo = new JdbmRepository(root);
+
+        Artifact artifact = new Artifact("group", "artifact", "1.0", "jar");
+        File file = repo.getLocation(artifact);
+
+        assertEquals("artifact-1.0.jar", file.getName());
+        assertEquals("1954591822", file.getParentFile().getName()); // 1954591822 is the
expected g+a+v hash
+    }
+}

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/geronimo-repository-jdbm/src/test/java/org/apache/geronimo/repository/jdbm/JdbmRepositoryTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml (added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml Sat
Jul 22 20:02:05 2006
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-repository</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <artifactId>geronimo-repository-providers</artifactId>
+    <name>Geronimo Repository :: Providers</name>
+    <packaging>pom</packaging>
+    
+    <modules>
+        <module>geronimo-repository-jdbm</module>
+    </modules>
+    
+</project>

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/geronimo-repository-providers/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/geronimo-repository/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/geronimo-repository/pom.xml?rev=424668&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/geronimo-repository/pom.xml (added)
+++ geronimo/sandbox/svkmerge/geronimo-repository/pom.xml Sat Jul 22 20:02:05 2006
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>modules</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <artifactId>geronimo-repository</artifactId>
+    <name>Geronimo :: Repository</name>
+    <packaging>pom</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${pom.version}</version>
+            <type>jar</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${pom.version}</version>
+            <type>jar</type>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <!-- FIXME: Remove when the default is to use the m2 standard layout -->
+        <sourceDirectory>${pom.basedir}/src/main/java</sourceDirectory>
+        <testSourceDirectory>${pom.basedir}/src/test/java</testSourceDirectory>
+    </build>
+    
+    <modules>
+        <module>geronimo-repository-api</module>
+        <module>geronimo-repository-providers</module>
+    </modules>
+    
+</project>

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/geronimo-repository/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message