You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2006/03/10 17:48:09 UTC

svn commit: r384848 - /incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java

Author: stefan
Date: Fri Mar 10 08:48:07 2006
New Revision: 384848

URL: http://svn.apache.org/viewcvs?rev=384848&view=rev
Log:
fixing document view export test case: skipping multi-valued properties entirely is legal according to "6.4.2.5 Multi-value Properties"

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java?rev=384848&r1=384847&r2=384848&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java Fri Mar 10 08:48:07 2006
@@ -436,8 +436,9 @@
     private void checkAttribute(Property prop, Attr attribute) throws RepositoryException {
 
         boolean isBinary = (prop.getType() == PropertyType.BINARY);
+        boolean isMultiple = prop.getDefinition().isMultiple();
         if (skipBinary) {
-            if (isBinary) {
+            if (isBinary && !(isMultiple && !exportMultivalProps)) {
                 assertEquals("Value of binary property " + prop.getPath() +
                         " exported although skipBinary is true",
                         attribute.getValue().length(), 0);
@@ -449,7 +450,7 @@
         }
         // saveBinary
         else {
-            if (isBinary) {
+            if (isBinary && !(isMultiple && !exportMultivalProps)) {
                 assertTrue("Binary property " + prop.getPath() +
                         " not exported although skipBinary is false", attribute != null);
             }
@@ -473,9 +474,16 @@
         boolean isMultiple = prop.getDefinition().isMultiple();
         boolean isValidName = XMLChar.isValidName(name);
 
-        if (exportMultivalProps && isMultiple) {
-            assertTrue("Not all multivalued properties are exported: "
-                    + prop.getPath() + " is not exported.", attribute != null);
+        if (isMultiple) {
+            if (exportMultivalProps) {
+                assertTrue("Not all multivalued properties are exported: "
+                        + prop.getPath() + " is not exported.", attribute != null);
+            } else {
+                // skipping multi-valued properties entirely is legal
+                // according to "6.4.2.5 Multi-value Properties" of the
+                // jsr-170 specification
+                return;
+            }
         }
         // check anyway the other flag
         if (exportInvalidXmlNames && !isValidName) {
@@ -774,6 +782,9 @@
             PropertyIterator iter = node.getProperties();
             while (iter.hasNext()) {
                 Property prop = iter.nextProperty();
+                if (!exportMultivalProps && prop.getDefinition().isMultiple()) {
+                    continue;
+                }
                 if (!XMLChar.isValidName(prop.getName())) {
                     // property exported?
                     exportInvalidXmlNames = isExportedProp(prop, elem);