jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r280801 - in /incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api: AbstractWorkspaceCopyBetweenTest.java AbstractWorkspaceSameNameSibsTest.java
Date Wed, 14 Sep 2005 08:05:03 GMT
Author: mreutegg
Date: Wed Sep 14 01:04:56 2005
New Revision: 280801

URL: http://svn.apache.org/viewcvs?rev=280801&view=rev
Log:
- Test cases may fail on repositories that do not support same-name siblings
See also: http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/3496

Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java?rev=280801&r1=280800&r2=280801&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceCopyBetweenTest.java
Wed Sep 14 01:04:56 2005
@@ -104,6 +104,11 @@
         // testroot
         if (superuserW2.getRootNode().hasNode(testPath)) {
             testRootNodeW2 = superuserW2.getRootNode().getNode(testPath);
+            // clean test root
+            for (NodeIterator it = testRootNodeW2.getNodes(); it.hasNext(); ) {
+                it.nextNode().remove();
+            }
+            testRootNodeW2.save();
         } else {
             testRootNodeW2 = superuserW2.getRootNode().addNode(testPath, testNodeType);
             superuserW2.save();
@@ -115,7 +120,5 @@
 
         superuserW2.getWorkspace().copy(workspace.getName(), node2.getPath(), node2.getPath());
         node2W2 = testRootNodeW2.getNode(node2.getName());
-
-        testRootNodeW2.save();
     }
 }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java?rev=280801&r1=280800&r2=280801&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java
Wed Sep 14 01:04:56 2005
@@ -60,21 +60,17 @@
         // make sure 'sameNameSibsTrue' nodetype is properly defined
         try {
             sameNameSibsTrueNodeType = ntMgr.getNodeType(getProperty(PROP_SAME_NAME_SIBS_TRUE_NODE_TYPE));
-            if (sameNameSibsTrueNodeType == null) {
-                fail("Property 'sameNameSibsTrueNodeType' does not define a nodetype where
sameNameSibs are allowed: '" + sameNameSibsTrueNodeType.getName() + "'");
-            } else {
-                NodeDefinition[] childNodeDefs = sameNameSibsTrueNodeType.getDeclaredChildNodeDefinitions();
-                boolean isSameNameSibs = false;
-                for (int i = 0; i < childNodeDefs.length; i++) {
-                    if (childNodeDefs[i].allowsSameNameSiblings()) {
-                        isSameNameSibs = true;
-                        break;
-                    }
-                }
-                if (!isSameNameSibs) {
-                    throw new NotExecutableException("Property 'sameNameSibsTrueNodeType'
does not define a nodetype where sameNameSibs are allowed: '" + sameNameSibsTrueNodeType.getName()
+ "'");
+            NodeDefinition[] childNodeDefs = sameNameSibsTrueNodeType.getDeclaredChildNodeDefinitions();
+            boolean isSameNameSibs = false;
+            for (int i = 0; i < childNodeDefs.length; i++) {
+                if (childNodeDefs[i].allowsSameNameSiblings()) {
+                    isSameNameSibs = true;
+                    break;
                 }
             }
+            if (!isSameNameSibs) {
+                throw new NotExecutableException("Property 'sameNameSibsTrueNodeType' does
not define a nodetype where sameNameSibs are allowed: '" + sameNameSibsTrueNodeType.getName()
+ "'");
+            }
         } catch (NoSuchNodeTypeException e) {
             fail("Property 'sameNameSibsTrueNodeType' does not define an existing nodetype:
'" + sameNameSibsTrueNodeType + "'");
         }
@@ -83,20 +79,16 @@
         // make sure 'sameNameSibsFalse' nodetype is properly defined
         try {
             sameNameSibsFalseNodeType = ntMgr.getNodeType(getProperty(PROP_SAME_NAME_SIBS_FALSE_NODE_TYPE));
-            if (sameNameSibsFalseNodeType == null) {
-                fail("Property 'sameNameSibsFalseNodeType' does define a nodetype where sameNameSibs
are allowed: '" + sameNameSibsFalseNodeType.getName() + "'");
-            } else {
-                NodeDefinition[] childNodeDefs = sameNameSibsFalseNodeType.getDeclaredChildNodeDefinitions();
-                boolean isSameNameSibs = true;
-                for (int i = 0; i < childNodeDefs.length; i++) {
-                    if (!childNodeDefs[i].allowsSameNameSiblings()) {
-                        isSameNameSibs = false;
-                        break;
-                    }
-                }
-                if (isSameNameSibs) {
-                    fail("Property 'sameNameSibsFalseNodeType' does define a nodetype where
sameNameSibs are allowed: '" + sameNameSibsFalseNodeType.getName() + "'");
+            NodeDefinition[] childNodeDefs = sameNameSibsFalseNodeType.getDeclaredChildNodeDefinitions();
+            boolean isSameNameSibs = true;
+            for (int i = 0; i < childNodeDefs.length; i++) {
+                if (!childNodeDefs[i].allowsSameNameSiblings()) {
+                    isSameNameSibs = false;
+                    break;
                 }
+            }
+            if (isSameNameSibs) {
+                fail("Property 'sameNameSibsFalseNodeType' does define a nodetype where sameNameSibs
are not allowed: '" + sameNameSibsFalseNodeType.getName() + "'");
             }
         } catch (NoSuchNodeTypeException e) {
             fail("Property 'sameNameSibsFalseNodeType' does not define an existing nodetype:
'" + sameNameSibsFalseNodeType + "'");



Mime
View raw message