jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1443365 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OrderableNodesTest.java
Date Thu, 07 Feb 2013 09:29:40 GMT
Author: angela
Date: Thu Feb  7 09:29:40 2013
New Revision: 1443365

URL: http://svn.apache.org/viewvc?rev=1443365&view=rev
Log:
OAK-612: two tests

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OrderableNodesTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OrderableNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OrderableNodesTest.java?rev=1443365&r1=1443364&r2=1443365&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OrderableNodesTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OrderableNodesTest.java
Thu Feb  7 09:29:40 2013
@@ -16,15 +16,17 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
-import org.junit.Test;
-
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.junit.Ignore;
+import org.junit.Test;
+
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
 
 public class OrderableNodesTest extends AbstractRepositoryTest {
 
@@ -40,6 +42,44 @@ public class OrderableNodesTest extends 
         doTest("test:orderableFolder");
     }
 
+    @Ignore("OAK-612")
+    @Test
+    public void testAddNode() throws Exception {
+        new TestContentLoader().loadTestContent(getAdminSession());
+
+        Session session = getAdminSession();
+        Node test = session.getRootNode().addNode("test", "test:orderableFolder");
+        assertTrue(test.getPrimaryNodeType().hasOrderableChildNodes());
+
+        Node n1 = test.addNode("a");
+        Node n2 = test.addNode("b");
+        session.save();
+
+        NodeIterator it = test.getNodes();
+        assertEquals("a", it.nextNode().getName());
+        assertEquals("b", it.nextNode().getName());
+    }
+
+    @Ignore("OAK-612")
+    @Test
+    public void testAddNode2() throws Exception {
+        new TestContentLoader().loadTestContent(getAdminSession());
+
+        Session session = getAdminSession();
+        Node test = session.getRootNode().addNode("test", "test:orderableFolder");
+        Node n1 = test.addNode("a");
+        Node n2 = test.addNode("b");
+        session.save();
+
+        test.getNode("a").remove();
+        test.addNode("a");
+        session.save();
+
+        NodeIterator it = test.getNodes();
+        assertEquals("b", it.nextNode().getName());
+        assertEquals("a", it.nextNode().getName());
+    }
+
     private void doTest(String nodeType) throws RepositoryException {
         Session session = getAdminSession();
         Node root = session.getRootNode().addNode("test", nodeType);



Mime
View raw message