jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1224941 - in /jackrabbit/sandbox/jackrabbit-microkernel: pom.xml src/main/java/org/apache/jackrabbit/Path.java src/test/java/org/apache/jackrabbit/RepositoryTest.java
Date Tue, 27 Dec 2011 16:34:04 GMT
Author: mduerig
Date: Tue Dec 27 16:34:04 2011
New Revision: 1224941

URL: http://svn.apache.org/viewvc?rev=1224941&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- equality for paths
- upgrade JUnit
- clean repository before test runs

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/pom.xml
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/RepositoryTest.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/pom.xml?rev=1224941&r1=1224940&r2=1224941&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/pom.xml (original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/pom.xml Tue Dec 27 16:34:04 2011
@@ -82,7 +82,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.5</version>
+            <version>4.6</version>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java?rev=1224941&r1=1224940&r2=1224941&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
Tue Dec 27 16:34:04 2011
@@ -21,7 +21,7 @@ package org.apache.jackrabbit;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
 
-public class Path {
+public final class Path {
     private final String workspace;
     private final String path;
 
@@ -117,6 +117,28 @@ public class Path {
         return workspace + ':' + path;
     }
 
+    @Override
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (!(other instanceof Path)) {
+            return false;
+        }
+
+        Path otherPath = (Path) other;
+
+        return (path == null ? otherPath.path == null : path.equals(otherPath.path))
+            && (workspace == null ? otherPath.workspace == null : workspace.equals(otherPath.workspace));
+
+    }
+
+    @Override
+    public int hashCode() {
+        return 31 * (workspace == null ? 0 : workspace.hashCode())
+                  + (path == null ? 0 : path.hashCode());
+    }
+
     //------------------------------------------< private >---
 
     private static String buildMkPath(String workspace, String path) {

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/RepositoryTest.java?rev=1224941&r1=1224940&r2=1224941&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/RepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/RepositoryTest.java
Tue Dec 27 16:34:04 2011
@@ -19,11 +19,11 @@
 package org.apache.jackrabbit;
 
 import org.apache.jackrabbit.configuration.RepositoryConfiguration;
+import org.apache.jackrabbit.mk.MicroKernelFactory;
+import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.util.Loop;
 import org.apache.jackrabbit.util.NumberStream;
 import org.apache.jackrabbit.utils.Arrays;
-import org.apache.jackrabbit.mk.MicroKernelFactory;
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -80,7 +80,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 public class RepositoryTest {
-    private static final String URL = "fs:target/repository-test/repository";
+    private static final String URL = "fs:target/repository-test/repository;clean";
     // private static final String URL = "mem:";
 
     private static final String TEST_NODE = "test_node";



Mime
View raw message