jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r527952 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
Date Thu, 12 Apr 2007 14:17:17 GMT
Author: reschke
Date: Thu Apr 12 07:17:11 2007
New Revision: 527952

URL: http://svn.apache.org/viewvc?view=rev&rev=527952
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/SetValueBinaryTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java?view=diff&rev=527952&r1=527951&r2=527952
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
Thu Apr 12 07:17:11 2007
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.test.api;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.Property;
 import javax.jcr.Value;
@@ -126,7 +127,11 @@
      * Test the deletion of a property by assigning it a null value, saved from
      * the Session
      */
-    public void testRemoveBinarySession() throws RepositoryException {
+    public void testRemoveBinarySession() throws RepositoryException, NotExecutableException
{
+        if (property1.getDefinition().isMandatory() || property1.getDefinition().isProtected())
{
+            throw new NotExecutableException("property " + property1.getName() + " can not
be removed");
+        }
+      
         property1.setValue((InputStream) null);
         superuser.save();
 
@@ -142,7 +147,11 @@
      * Test the deletion of a property by assigning it a null value, saved from
      * the parent Node
      */
-    public void testRemoveBinaryParent() throws RepositoryException {
+    public void testRemoveBinaryParent() throws RepositoryException, NotExecutableException
{
+        if (property1.getDefinition().isMandatory() || property1.getDefinition().isProtected())
{
+            throw new NotExecutableException("property " + property1.getName() + " can not
be removed");
+        }
+
         property1.setValue((Value) null);
         node.save();
 



Mime
View raw message