jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1214411 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Date Wed, 14 Dec 2011 19:13:28 GMT
Author: mduerig
Date: Wed Dec 14 19:13:27 2011
New Revision: 1214411

URL: http://svn.apache.org/viewvc?rev=1214411&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
remove test cases which are now in the Microkernel module

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java?rev=1214411&r1=1214410&r2=1214411&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Wed Dec 14 19:13:27 2011
@@ -19,10 +19,8 @@
 
 package org.apache.jackrabbit.spi2microkernel;
 
-import junit.framework.Assert;
 import org.apache.jackrabbit.mk.MicroKernelFactory;
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.spi2microkernel.json.DefaultJsonTokenizer;
 import org.apache.jackrabbit.spi2microkernel.json.FullJsonParser;
 import org.apache.jackrabbit.spi2microkernel.json.JsonHandler;
@@ -39,7 +37,6 @@ import org.apache.jackrabbit.spi2microke
 import org.apache.jackrabbit.spi2microkernel.util.NumberStream;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.IOException;
@@ -47,8 +44,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 public class MicrokernelTest {
@@ -104,215 +99,6 @@ public class MicrokernelTest {
     }
 
     @Test
-    public void getNodes() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        String json = mk.getNodes("/test", head, 0, 0, -1);
-        assertTrue(json.contains("stringProp"));
-    }
-
-    @Test
-    public void missingName() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        assertTrue(mk.nodeExists("/test", head));
-        try {
-            String path = "/test/";
-            mk.getNodes(path, head);
-            Assert.fail("Success with invalid path: " + path);
-        } catch (MicroKernelException e) {
-            // expected
-        }
-    }
-
-    @Test
-    public void addNodeWithRelativePath() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        head = mk.commit("/", "+\"foo\" : {} \n+\"foo/bar\" : {}", head, "");
-        assertTrue(mk.nodeExists("/foo", head));
-        assertTrue(mk.nodeExists("/foo/bar", head));
-    }
-
-    @Test
-    public void addPropertyWithRelativePath() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        head = mk.commit("/",
-                "+\"fuu\" : {} \n" +
-                "^\"fuu/bar\" : 42", head, "");
-        String n = mk.getNodes("/fuu", head);
-        assertEquals("{\"bar\":42,\":childNodeCount\":0}", n);
-    }
-
-    @Test
-    public void addMultipleNodes() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        long millis = System.currentTimeMillis();
-        String node1 = "n1_" + millis;
-        String node2 = "n2_" + millis;
-        head = mk.commit("/", "+\"" + node1 + "\" : {} \r+\"" + node2 + "\" : {}\n", head,
"");
-        assertTrue(mk.nodeExists('/' + node1, head));
-        assertTrue(mk.nodeExists('/' + node2, head));
-    }
-
-    @Test
-    public void addDeepNodes() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        head = mk.commit("/",
-                "+\"a\" : {} \r" +
-                "+\"a/b\" : {} \r" +
-                "+\"a/b/c\" : {} \r" +
-                "+\"a/b/c/d\" : {} \r",
-            head, "");
-
-        assertTrue(mk.nodeExists("/a", head));
-        assertTrue(mk.nodeExists("/a/b", head));
-        assertTrue(mk.nodeExists("/a/b/c", head));
-        assertTrue(mk.nodeExists("/a/b/c/d", head));
-    }
-
-    @Test
-    public void addItemsIncrementally() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        String node = "n_" + System.currentTimeMillis();
-
-        head = mk.commit("/",
-                "+\"" + node + "\" : {} \r" +
-                "+\"" + node + "/child1\" : {} \r" +
-                "+\"" + node + "/child2\" : {} \r" +
-                "+\"" + node + "/child1/grandchild11\" : {} \r" +
-                "^\"" + node + "/prop1\" : 41\r" +
-                "^\"" + node + "/child1/prop2\" : 42\r" +
-                "^\"" + node + "/child1/grandchild11/prop3\" : 43",
-                head, "");
-
-        String json = mk.getNodes('/' + node, head, 3, 0, -1);
-        assertEquals("{\"prop1\":41,\":childNodeCount\":2," +
-                "\"child1\":{\"prop2\":42,\":childNodeCount\":1," +
-                "\"grandchild11\":{\"prop3\":43,\":childNodeCount\":0}}," +
-                "\"child2\":{\":childNodeCount\":0}}", json);
-    }
-
-    @Test
-    public void removeNode() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-        String node = "removeNode_" + System.currentTimeMillis();
-
-        head = mk.commit("/", "+\"" + node + "\" : {\"child\":{}}", head, "");
-
-        head = mk.commit('/' + node, "-\"child\"", head, "");
-        String json = mk.getNodes('/' + node, head);
-        assertEquals("{\":childNodeCount\":0}", json);
-    }
-
-    @Test
-    public void moveNode() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-        String node = "moveNode_" + System.currentTimeMillis();
-        String movedNode = "movedNode_" + System.currentTimeMillis();
-        head = mk.commit("/", "+\"" + node + "\" : {}", head, "");
-
-        head = mk.commit("/", ">\"" + node + "\" : \"" + movedNode + '\"', head, "");
-        assertFalse(mk.nodeExists('/' + node, head));
-        assertTrue(mk.nodeExists('/' + movedNode, head));
-    }
-
-    @Test
-    public void overwritingMove() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        head = mk.commit("/", "+\"a\" : {} \r+\"b\" : {} \r", head, "");
-        try {
-            mk.commit("/", ">\"a\" : \"b\"  ", head, "");
-        }
-        catch (MicroKernelException e) {
-            // expected
-        }
-    }
-
-    @Test
-    public void conflictingMove() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        head = mk.commit("/", "+\"a\" : {} \r+\"b\" : {}\n", head, "");
-
-        String r1 = mk.commit("/", ">\"a\" : \"b/a\"", head, "");
-        assertFalse(mk.nodeExists("/a", r1));
-        assertTrue(mk.nodeExists("/b", r1));
-        assertTrue(mk.nodeExists("/b/a", r1));
-
-        try {
-            mk.commit("/", ">\"b\" : \"a/b\"", head, "");
-        }
-        catch (MicroKernelException e) {
-            // expected
-        }
-    }
-
-    @Test
-    public void conflictingAddDelete() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-
-        head = mk.commit("/", "+\"a\" : {} \r+\"b\" : {}\n", head, "");
-
-        String r1 = mk.commit("/", "-\"b\" \r +\"a/x\" : {}", head, "");
-        assertFalse(mk.nodeExists("/b", r1));
-        assertTrue(mk.nodeExists("/a", r1));
-        assertTrue(mk.nodeExists("/a/x", r1));
-
-        try {
-            mk.commit("/", "-\"a\" \r +\"b/x\" : {}", head, "");
-        }
-        catch (MicroKernelException e) {
-            // expected
-        }
-    }
-
-    @Test
-    @Ignore
-    // todo fix microkernel
-    public void reorderNode() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-        String node = "reorderNode_" + System.currentTimeMillis();
-        head = mk.commit("/", "+\"" + node + "\" : {\"a\":{}, \"b\":{}, \"c\":{}}", head,
"");
-        System.out.println(mk.getNodes('/' + node, head).replaceAll("\"", "").replaceAll(":childNodeCount:.",
""));
-
-        head = mk.commit("/", ">\"" + node + "/a\" : \"" + node + "/c\" \"#before\"",
head, "");
-        System.out.println(mk.getNodes('/' + node, head).replaceAll("\"", "").replaceAll(":childNodeCount:.",
""));
-    }
-
-    @Test
-    public void removeProperty() {
-        MicroKernel mk = getMicroKernel();
-        String head = mk.getHeadRevision();
-        long t = System.currentTimeMillis();
-        String node = "removeProperty_" + t;
-
-        head = mk.commit("/", "+\"" + node + "\" : {\"prop\":\"value\"}", head, "");
-
-        head = mk.commit("/", "^\"" + node + "/prop\" : null", head, "");
-        String json = mk.getNodes('/' + node, head);
-        assertEquals("{\":childNodeCount\":0}", json);
-    }
-
-    @Test
     public void getStringProperty() {
         MicroKernel mk = getMicroKernel();
         String head = mk.getHeadRevision();



Mime
View raw message