jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r527141 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
Date Tue, 10 Apr 2007 14:21:05 GMT
Author: reschke
Date: Tue Apr 10 07:20:56 2007
New Revision: 527141

URL: http://svn.apache.org/viewvc?view=rev&rev=527141
Log:
JCR-838: allow test to pass when node is mix:referenceable by default. Fail with NotExecutableException
when reference property not supported. Allow specification of node type for referenceable
node.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java?view=diff&rev=527141&r1=527140&r2=527141
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
Tue Apr 10 07:20:56 2007
@@ -266,9 +266,20 @@
     public void testNode()
         throws NotExecutableException, RepositoryException {
 
+        String nodeType3 = getProperty("nodetype3");
+
         // create a referenceable node
-        Node referenceableNode = testRootNode.addNode(nodeName3);
-        referenceableNode.addMixin(mixReferenceable);
+        Node referenceableNode = testRootNode.addNode(nodeName3, nodeType3);
+
+        // try to make it referenceable if it is not
+        if (!node.isNodeType(mixReferenceable)) {
+            if (node.canAddMixin(mixReferenceable)) {
+                node.addMixin(mixReferenceable);
+            } else {
+                throw new NotExecutableException("Failed to set up required test items.");
+            }
+        }
+
         // implementation specific if mixin takes effect immediately or upon save
         testRootNode.save();
 
@@ -285,6 +296,9 @@
                 throw new NotExecutableException("Failed to set up required test items.");
             }
         }
+
+        // fail early when reference properties are not suppoerted
+        ensureCanSetProperty(node, refPropName, node.getSession().getValueFactory().createValue(referenceableNode));
 
         Property property = node.setProperty(refPropName, referenceableNode);
         testRootNode.save();



Mime
View raw message