jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r570442 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
Date Tue, 28 Aug 2007 14:23:17 GMT
Author: reschke
Date: Tue Aug 28 07:23:16 2007
New Revision: 570442

URL: http://svn.apache.org/viewvc?rev=570442&view=rev
Log:
JCR-1094: do not fail tests when repository automatically adds other mixin types

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java?rev=570442&r1=570441&r2=570442&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
Tue Aug 28 07:23:16 2007
@@ -60,13 +60,13 @@
 
         // test if mixin is written to property jcr:mixinTypes immediately
         Value mixinValues[] = node.getProperty(jcrMixinTypes).getValues();
-        if (mixinValues.length != 1) {
-            fail("Mixin node must be added to property " + jcrMixinTypes + " immediately.");
+        boolean found = false;
+        for (int i = 0; i < mixinValues.length; i++) {
+            found |= mixinName.equals(mixinValues[i].getString());
+        }
+        if (! found) {
+            fail("Mixin type must be added to property " + jcrMixinTypes + " immediately.");
         }
-        assertEquals("Mixin was not properly assigned to property " + jcrMixinTypes + ":
",
-                mixinName,
-                mixinValues[0].getString());
-
 
         // it is implementation-specific if a added mixin is available
         // before or after save therefore save before further tests
@@ -74,13 +74,13 @@
 
         // test if added mixin is available by node.getMixinNodeTypes()
         NodeType mixins[] = node.getMixinNodeTypes();
-        if (mixins.length != 1) {
-            fail("Mixin node not added.");
+        found = false;
+        for (int i = 0; i < mixins.length; i++) {
+            found |= mixinName.equals(mixins[i].getName());
+        }
+        if (! found) {
+            fail("Mixin '" + mixinName+ "' type not added.");
         }
-        assertEquals("Mixin was not properly assigned: ",
-                mixinName,
-                mixins[0].getName());
-
     }
 
     /**



Mime
View raw message