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 16:17:17 UTC
svn commit: r527952 -
/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
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();