jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r581525 - /jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderTest.java
Date Wed, 03 Oct 2007 08:29:33 GMT
Author: angela
Date: Wed Oct  3 01:29:32 2007
New Revision: 581525

URL: http://svn.apache.org/viewvc?rev=581525&view=rev
Log:
tests -> test size of reordered children more carefully

Modified:
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderTest.java

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderTest.java?rev=581525&r1=581524&r2=581525&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderTest.java
(original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/ReorderTest.java
Wed Oct  3 01:29:32 2007
@@ -33,13 +33,13 @@
         if (!testRootNode.getPrimaryNodeType().hasOrderableChildNodes()) {
             throw new NotExecutableException("Test node does not have orderable children.");
         }
+        NodeIterator it = testRootNode.getNodes();
+        if (it.hasNext()) {
+            throw new NotExecutableException("Test node already contains child nodes");
+        }
         createOrderableChildren();
     }
 
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
     protected void createOrderableChildren() throws RepositoryException, LockException, ConstraintViolationException,
NoSuchNodeTypeException, ItemExistsException, VersionException, NotExecutableException {
         child1 = testRootNode.addNode(nodeName1, testNodeType);
         child2 = testRootNode.addNode(nodeName2, testNodeType);
@@ -63,10 +63,14 @@
         while (it.hasNext()) {
             Node child = it.nextNode();
             if (i >= children.length) {
-                fail("Reorder removed a child node.");
+                fail("Reorder added a child node.");
             }
             assertTrue("Wrong order of children: " + child + " is not the same as " + children[i],
child.isSame(children[i]));
             i++;
+        }
+
+        if (i < children.length-1) {
+            fail("Reorder removed a child node.");
         }
     }
 



Mime
View raw message