You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2006/08/02 19:05:35 UTC

svn commit: r428057 - /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java

Author: mreutegg
Date: Wed Aug  2 10:05:34 2006
New Revision: 428057

URL: http://svn.apache.org/viewvc?rev=428057&view=rev
Log:
JCR-514: TCK: NodeOrderableChildNodesTest tests node order even if node type doesn't support child node ordering

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java?rev=428057&r1=428056&r2=428057&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java (original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java Wed Aug  2 10:05:34 2006
@@ -109,17 +109,25 @@
      * that does not support child reordering. <br/><br/> This should throw and
      * {@link UnsupportedRepositoryOperationException}. Prequisites: <ul>
      * <li>javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype2</li>
-     * A valid node type that does not suport child node ordering.</li>
+     * A valid node type that does not support child node ordering.</li>
      * <li>javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype3</li>
      * A valid node type that can be added as a child. </ul>
      */
     public void testOrderBeforeUnsupportedRepositoryOperationException()
             throws RepositoryException, NotExecutableException {
-        prepareTest();
+
+        // create testNode
+        parentNode = testRootNode.addNode(nodeName1, getProperty("nodetype2"));
+        // add child node
+        Node firstNode = parentNode.addNode(nodeName2, getProperty("nodetype3"));
+        // add a second child node
+        Node secondNode = parentNode.addNode(nodeName3, getProperty("nodetype3"));
+        // save the new nodes
+        superuser.save();
 
         // ok lets try to reorder
         try {
-            parentNode.orderBefore(initialSecondNode.getName(), initialFirstNode.getName());
+            parentNode.orderBefore(secondNode.getName(), firstNode.getName());
             fail("Trying to reorder child nodes using Node.orderBefore() on node that " +
                     "does not support ordering should throw UnsupportedRepositoryException!");
         } catch (UnsupportedRepositoryOperationException e) {