jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r570520 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencePropertyTest.java
Date Tue, 28 Aug 2007 18:45:48 GMT
Author: reschke
Date: Tue Aug 28 11:45:47 2007
New Revision: 570520

URL: http://svn.apache.org/viewvc?rev=570520&view=rev
Log:
JCR-1095: modify the test setup so that it also digs multivalued properties

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencePropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencePropertyTest.java?rev=570520&r1=570519&r2=570520&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencePropertyTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ReferencePropertyTest.java
Tue Aug 28 11:45:47 2007
@@ -24,6 +24,8 @@
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
 
+import org.apache.jackrabbit.test.NotExecutableException;
+
 /**
  * Tests a reference property. If the workspace does not contain a node with
  * a reference property a {@link org.apache.jackrabbit.test.NotExecutableException}
@@ -44,7 +46,16 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        referencedNode = prop.getNode();
+        if (prop.getDefinition().isMultiple()) {
+            Value v[] = prop.getValues();
+            if (v.length == 0) {
+                throw new NotExecutableException("Property " + prop.getName() + " is multivalued
with length 0");
+            }
+            referencedNode = prop.getSession().getNodeByUUID(prop.getValues()[0].getString());
+        }
+        else {
+            referencedNode = prop.getNode();
+        }
     }
 
     /**



Mime
View raw message