You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by st...@apache.org on 2012/05/11 17:44:34 UTC
svn commit: r1337217 -
/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
Author: stefan
Date: Fri May 11 15:44:34 2012
New Revision: 1337217
URL: http://svn.apache.org/viewvc?rev=1337217&view=rev
Log:
OAK-12: Implement a test suite for the MicroKernel (WIP)
Modified:
jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java?rev=1337217&r1=1337216&r2=1337217&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java (original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java Fri May 11 15:44:34 2012
@@ -255,15 +255,27 @@ public class MicroKernelIT extends Abstr
}
@Test
+ public void copy() {
+ mk.commit("/", "*\"test\":\"testCopy\"", null, "");
+
+ assertTrue(mk.nodeExists("/testCopy", null));
+ assertTrue(mk.nodeExists("/test", null));
+
+ JSONObject obj = parseJSONObject(mk.getNodes("/test", null, 99, 0, -1, null));
+ JSONObject obj1 = parseJSONObject(mk.getNodes("/testCopy", null, 99, 0, -1, null));
+ assertEquals(obj, obj1);
+ }
+
+ @Test
public void addAndCopy() {
mk.commit("/",
"+\"x\":{}\n" +
- "+\"y\":{}\n",
+ "+\"y\":{}\n",
null, "");
mk.commit("/",
"+\"x/a\":{}\n" +
- "*\"x\":\"y/x1\"\n",
+ "*\"x\":\"y/x1\"\n",
null, "");
assertTrue(mk.nodeExists("/x/a", null));
@@ -593,7 +605,7 @@ public class MicroKernelIT extends Abstr
public void moveNode() {
String head = mk.getHeadRevision();
String node = "moveNode_" + System.currentTimeMillis();
- String movedNode = "movedNode_" + System.currentTimeMillis();
+ String movedNode = "movedNode_" + System.currentTimeMillis() + 1;
head = mk.commit("/", "+\"" + node + "\" : {}", head, "");
head = mk.commit("/", ">\"" + node + "\" : \"" + movedNode + '\"', head, "");