jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r384546 - /incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
Date Thu, 09 Mar 2006 16:30:35 GMT
Author: jukka
Date: Thu Mar  9 08:30:34 2006
New Revision: 384546

URL: http://svn.apache.org/viewcvs?rev=384546&view=rev
Log:
JCR-333: Fixed a test case that expected a specific ordering of node type information.

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java?rev=384546&r1=384545&r2=384546&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
Thu Mar  9 08:30:34 2006
@@ -19,7 +19,6 @@
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
-import org.apache.jackrabbit.core.nodetype.ItemDef;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.PropDef;
@@ -91,13 +90,21 @@
      * Returns the named property definition from the named node type
      * definition. If either of the definitions do not exist, an assertion
      * failure is generated.
+     * <p>
+     * If the given property name is <code>null</code>, then the residual
+     * property definition (if one exists) is returned. 
      *
      * @param typeName node type name
-     * @param propertyName property name
+     * @param propertyName property name, or <code>null</code>
      * @return property definition
      */
     private PropDef getProperty(String typeName, String propertyName) {
-        QName name = new QName(TEST_NAMESPACE, propertyName);
+        QName name;
+        if (propertyName != null) {
+            name = new QName(TEST_NAMESPACE, propertyName);
+        } else {
+            name = PropDef.ANY_NAME;
+        }
 
         NodeTypeDef def = getNodeType(typeName);
         PropDef[] defs = def.getPropertyDefs();
@@ -199,8 +206,8 @@
                 def.getPrimaryItemName());
         assertEquals("itemNodeType propertyDefs",
                 10, def.getPropertyDefs().length);
-        PropDef[] defs = def.getPropertyDefs();
-        assertTrue("itemNodeType wildcard property", defs[0].definesResidual());
+        PropDef pdef = getProperty("itemNodeType", null);
+        assertTrue("itemNodeType wildcard property", pdef.definesResidual());
     }
 
     /** Test for the empty item definition. */
@@ -481,12 +488,12 @@
         NodeDef def = getChildNode("childNodeType", "requiredTypeNode");
         assertEquals("requiredTypeNode requiredPrimaryTypes",
                 2, def.getRequiredPrimaryTypes().length);
+        QName[] types = def.getRequiredPrimaryTypes();
+        Arrays.sort(types);
         assertEquals("requiredTypeNode requiredPrimaryTypes[0]",
-                new QName(TEST_NAMESPACE, "baseType"),
-                def.getRequiredPrimaryTypes()[0]);
+                new QName(TEST_NAMESPACE, "baseType"), types[0]);
         assertEquals("requiredTypeNode requiredPrimaryTypes[1]",
-                new QName(TEST_NAMESPACE, "testType"),
-                def.getRequiredPrimaryTypes()[1]);
+                new QName(TEST_NAMESPACE, "testType"), types[1]);
     }
 
     /**



Mime
View raw message