You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2007/04/12 17:37:47 UTC

svn commit: r527982 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyInputStreamTest.java

Author: reschke
Date: Thu Apr 12 08:37:46 2007
New Revision: 527982

URL: http://svn.apache.org/viewvc?view=rev&rev=527982
Log:
JCR-842: throw NotExecutableException on removal tests when the configured binary property is mandatory or protected.

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyInputStreamTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyInputStreamTest.java?view=diff&rev=527982&r1=527981&r2=527982
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyInputStreamTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyInputStreamTest.java Thu Apr 12 08:37:46 2007
@@ -17,8 +17,10 @@
 package org.apache.jackrabbit.test.api;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.Node;
+import javax.jcr.Property;
 
 import java.io.InputStream;
 import java.io.ByteArrayInputStream;
@@ -134,6 +136,12 @@
     public void testRemoveInputStreamPropertySession() throws Exception {
         testNode.setProperty(propertyName1, is1);
         superuser.save();
+
+        Property property = testNode.getProperty(propertyName1);
+        if (property.getDefinition().isMandatory() || property.getDefinition().isProtected()) {
+            throw new NotExecutableException("property " + property.getName() + " can not be removed");
+        }
+
         testNode.setProperty(propertyName1, (InputStream) null);
         superuser.save();
         assertFalse("Removing property with Node.setProperty(String, (InputStream)null) and Session.save() not working",
@@ -148,6 +156,12 @@
     public void testRemoveInputStreamPropertyParent() throws Exception {
         testNode.setProperty(propertyName1, is1);
         testRootNode.save();
+        
+        Property property = testNode.getProperty(propertyName1);
+        if (property.getDefinition().isMandatory() || property.getDefinition().isProtected()) {
+            throw new NotExecutableException("property " + property.getName() + " can not be removed");
+        }
+
         testNode.setProperty(propertyName1, (InputStream) null);
         testRootNode.save();
         assertFalse("Removing property with Node.setProperty(String, (InputStream)null) and parentNode.save() not working",