jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1151115 - in /jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel: MicrokernelTest.java RepositoryTest.java
Date Tue, 26 Jul 2011 14:31:31 GMT
Author: mduerig
Date: Tue Jul 26 14:31:30 2011
New Revision: 1151115

URL: http://svn.apache.org/viewvc?rev=1151115&view=rev
Log:
spi2microkernel (WIP)
- test: reorder

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

Modified: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java?rev=1151115&r1=1151114&r2=1151115&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Tue Jul 26 14:31:30 2011
@@ -31,13 +31,12 @@ import org.json.simple.parser.JSONParser
 import org.json.simple.parser.ParseException;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.IOException;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 public class MicrokernelTest {
 
@@ -166,6 +165,20 @@ public class MicrokernelTest {
     }
 
     @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();

Modified: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java?rev=1151115&r1=1151114&r2=1151115&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Tue Jul 26 14:31:30 2011
@@ -36,6 +36,7 @@ import javax.jcr.Binary;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.NoSuchWorkspaceException;
 import javax.jcr.Node;
+import javax.jcr.NodeIterator;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
 import javax.jcr.PropertyType;
@@ -928,6 +929,30 @@ public class RepositoryTest {
     }
 
     @Test
+    @Ignore  // todo fix microkernel
+    public void reorderTest() throws RepositoryException {
+        Node testNode = getNode(testPath);
+        testNode.addNode("a");
+        testNode.addNode("b");
+        testNode.addNode("c");
+        getSession().save();
+
+        NodeIterator it = testNode.getNodes();
+        while (it.hasNext()) {
+            System.out.println(it.nextNode().getPath());
+        }
+
+        testNode.orderBefore("a", "c");
+        getSession().save();
+
+        it = testNode.getNodes();
+        while (it.hasNext()) {
+            System.out.println(it.nextNode().getPath());
+        }
+        
+    }
+
+    @Test
     public void nodeTypeRegistry() throws RepositoryException {
         NodeTypeManager ntMgr = getSession().getWorkspace().getNodeTypeManager();
         assertFalse(ntMgr.hasNodeType("foo"));



Mime
View raw message