jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1209564 - in /jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk: MoveNodeTest.java MultiMkTestBase.java wrapper/IndexWrapperTest.java wrapper/SecurityWrapperTest.java wrapper/VirtualRepositoryWrapperTest.java
Date Fri, 02 Dec 2011 16:28:53 GMT
Author: thomasm
Date: Fri Dec  2 16:28:52 2011
New Revision: 1209564

URL: http://svn.apache.org/viewvc?rev=1209564&view=rev
Log:
Simplified skipping of tests for implementations where certain features are not implemented.

Modified:
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/SecurityWrapperTest.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/VirtualRepositoryWrapperTest.java

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java?rev=1209564&r1=1209563&r2=1209564&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MoveNodeTest.java
Fri Dec  2 16:28:52 2011
@@ -48,7 +48,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void addProperty() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -74,7 +74,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void rename() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -91,7 +91,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void reorderBefore() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -108,7 +108,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void reorderAfter() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -130,7 +130,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void moveFirst() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -149,7 +149,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void moveCombinedWithSet() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -170,7 +170,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void moveBefore() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -189,7 +189,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void moveAfter() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 
@@ -214,7 +214,7 @@ public class MoveNodeTest extends MultiM
 
     @Test
     public void moveLast() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java?rev=1209564&r1=1209563&r2=1209564&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
Fri Dec  2 16:28:52 2011
@@ -45,10 +45,6 @@ public class MultiMkTestBase {
     @Before
     public void setUp() throws Exception {
         mk = MicroKernelFactory.getInstance(url + ";clean");
-        if (url.startsWith("remote:")) {
-            /* remove prefix so tests know when to run */
-            url = url.substring("remote:".length());
-        }
     }
 
     @After
@@ -63,4 +59,13 @@ public class MultiMkTestBase {
         }
     }
 
+    /**
+     * Whether this is (directly or indirectly) the MemoryKernelImpl.
+     *
+     * @return true if it is
+     */
+    public static boolean isMemoryKernel(MicroKernel mk) {
+        return mk.nodeExists("/:info", mk.getHeadRevision());
+    }
+
 }

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java?rev=1209564&r1=1209563&r2=1209564&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
Fri Dec  2 16:28:52 2011
@@ -45,7 +45,7 @@ public class IndexWrapperTest extends Mu
 
     @Test
     public void prefix() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         head = mk.commit("/index", "+ \"prefix:x\": {}", head, "");
@@ -64,7 +64,7 @@ public class IndexWrapperTest extends Mu
 
     @Test
     public void propertyUnique() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         head = mk.commit("/index", "+ \"property:id,unique\": {}", head, "");
@@ -78,7 +78,7 @@ public class IndexWrapperTest extends Mu
 
     @Test
     public void propertyNonUnique() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         head = mk.commit("/index", "+ \"property:ref\": {}", head, "");

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/SecurityWrapperTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/SecurityWrapperTest.java?rev=1209564&r1=1209563&r2=1209564&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/SecurityWrapperTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/SecurityWrapperTest.java
Fri Dec  2 16:28:52 2011
@@ -49,7 +49,7 @@ public class SecurityWrapperTest extends
     @Before
     public void setUp() throws Exception {
         super.setUp();
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         head = mk.getHeadRevision();
@@ -87,7 +87,7 @@ public class SecurityWrapperTest extends
 
     @Test
     public void commit() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         head = mkAdmin.commit("/", "+ \"test\": { \"data\": \"Hello\" }", head, null);
@@ -102,7 +102,7 @@ public class SecurityWrapperTest extends
 
     @Test
     public void getJournal() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         String fromRevision = mkAdmin.getHeadRevision();
@@ -129,7 +129,7 @@ public class SecurityWrapperTest extends
 
     @Test
     public void getNodes() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
         head = mk.getHeadRevision();

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/VirtualRepositoryWrapperTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/VirtualRepositoryWrapperTest.java?rev=1209564&r1=1209563&r2=1209564&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/VirtualRepositoryWrapperTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/wrapper/VirtualRepositoryWrapperTest.java
Fri Dec  2 16:28:52 2011
@@ -81,7 +81,7 @@ public class VirtualRepositoryWrapperTes
 
     @Test
     public void commit() {
-        if (url.startsWith("fs:")) {
+        if (!isMemoryKernel(mk)) {
             return;
         }
 



Mime
View raw message