jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r524776 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
Date Mon, 02 Apr 2007 12:56:49 GMT
Author: reschke
Date: Mon Apr  2 05:56:47 2007
New Revision: 524776

URL: http://svn.apache.org/viewvc?view=rev&rev=524776
Log:
JCR-830: allow tests to run with repositories that do support binary properties only on automatically
created child nodes of type nt:resource.

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=524776&r1=524775&r2=524776
==============================================================================
--- 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
Mon Apr  2 05:56:47 2007
@@ -32,8 +32,11 @@
  * Configuration requirements:<br/> The node at {@link #testRoot} must allow a
  * child node of type {@link #testNodeType} with name {@link #nodeName1}. The
  * node type {@link #testNodeType} must define a single value binary property
- * with name {@link #propertyName1}.
- *
+ * with name {@link #propertyName1}. <br>As a special case, if the specified node
+ * type automatically adds a jcr:content child node of type nt:resource, and
+ * <code>propertyName1</code> is specified as "jcr:data", that binary property
+ * is used instead.
+ * 
  * @test
  * @sources SetValueBinaryTest.java
  * @executeClass org.apache.jackrabbit.test.api.SetValueBinaryTest
@@ -70,6 +73,14 @@
 
         // create a new node under the testRootNode
         node = testRootNode.addNode(nodeName1, testNodeType);
+        testRootNode.save();
+
+        // special case for repositories that do allow binary property
+        // values, but only on jcr:content/jcr:data
+        if (propertyName1.equals("jcr:data") && node.hasNode("jcr:content")
+            && node.getNode("jcr:content").isNodeType("nt:resource") && !
node.hasProperty("jcr:data")) {
+            node = node.getNode("jcr:content");
+        }
 
         // create a new single-value property and save it
         property1 = node.setProperty(propertyName1, superuser.getValueFactory().createValue(new
ByteArrayInputStream(new byte[0])));



Mime
View raw message