jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r523719 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueValueFormatExceptionTest.java
Date Thu, 29 Mar 2007 14:11:13 GMT
Author: reschke
Date: Thu Mar 29 07:11:02 2007
New Revision: 523719

URL: http://svn.apache.org/viewvc?view=rev&rev=523719
Log:
JCR-827: SetValueValueFormatExceptionTest.java: in testNode(), make the type of the node being
created configurable; also handle the case where the node being created already is mix:referenceable.

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueValueFormatExceptionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueValueFormatExceptionTest.java?view=diff&rev=523719&r1=523718&r2=523719
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueValueFormatExceptionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueValueFormatExceptionTest.java
Thu Mar 29 07:11:02 2007
@@ -26,6 +26,8 @@
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
 import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.ConstraintViolationException;
+
 import java.io.InputStream;
 import java.io.ByteArrayInputStream;
 import java.util.Calendar;
@@ -210,10 +212,20 @@
 
         Property booleanProperty = createProperty(PropertyType.BOOLEAN, false);
         try {
-            Node referenceableNode = testRootNode.addNode(nodeName3);
-            referenceableNode.addMixin(mixReferenceable);
+            Node referenceableNode = testRootNode.addNode(nodeName3, testNodeType);
+            
+            try {
+                referenceableNode.addMixin(mixReferenceable);
+            }
+            catch (ConstraintViolationException ex) {
+                // may already be present in the node type
+            }
+
             // some implementations may require a save after addMixin()
             testRootNode.save();
+
+            // make sure the node is now referenceable
+            assertTrue("test node should be mix:referenceable", referenceableNode.isNodeType(mixReferenceable));
 
             booleanProperty.setValue(referenceableNode);
             fail("Property.setValue(Node) must throw a ValueFormatException " +



Mime
View raw message