jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r426000 - in /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype: NodeDefTest.java PropertyDefTest.java
Date Thu, 27 Jul 2006 08:15:11 GMT
Author: mreutegg
Date: Thu Jul 27 01:15:10 2006
New Revision: 426000

URL: http://svn.apache.org/viewvc?rev=426000&view=rev
Log:
JCR-496: TCK: PropertyDefTest and NodeDefTest do not respect the value of the testroot configuration
property

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/PropertyDefTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java?rev=426000&r1=425999&r2=426000&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
Thu Jul 27 01:15:10 2006
@@ -50,11 +50,6 @@
     private NodeTypeManager manager;
 
     /**
-     * The root node of the default workspace
-     */
-    private Node rootNode;
-
-    /**
      * If <code>true</code> indicates that the test found a mandatory node
      */
     private boolean foundMandatoryNode = false;
@@ -68,7 +63,8 @@
 
         session = helper.getReadOnlySession();
         manager = session.getWorkspace().getNodeTypeManager();
-        rootNode = session.getRootNode();
+        // re-fetch testRootNode with read-only session
+        testRootNode = (Node) session.getItem(testRoot);
     }
 
     /**
@@ -150,7 +146,7 @@
      * org.apache.jackrabbit.test.NotExecutableException} is thrown.
      */
     public void testIsMandatory() throws RepositoryException, NotExecutableException {
-        traverse(rootNode);
+        traverse(testRootNode);
         if (!foundMandatoryNode) {
             throw new NotExecutableException("Workspace does not contain any node with a
mandatory child node definition");
         }
@@ -204,8 +200,7 @@
                     for (int j = 0; j < requiredTypes.length; j++) {
                         NodeType requiredType = requiredTypes[j];
 
-                        boolean isSubType = false;
-                        isSubType = compareWithRequiredType(requiredType,
+                        boolean isSubType = compareWithRequiredType(requiredType,
                                 defaultType);
 
                         assertTrue("The NodeType returned by " +

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/PropertyDefTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/PropertyDefTest.java?rev=426000&r1=425999&r2=426000&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/PropertyDefTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/nodetype/PropertyDefTest.java
Thu Jul 27 01:15:10 2006
@@ -76,11 +76,6 @@
     private NodeTypeManager manager;
 
     /**
-     * The root node of the default workspace
-     */
-    private Node rootNode;
-
-    /**
      * If <code>true</code> indicates that the test found a mandatory property
      */
     private boolean foundMandatoryProperty = false;
@@ -94,7 +89,8 @@
 
         session = helper.getReadOnlySession();
         manager = session.getWorkspace().getNodeTypeManager();
-        rootNode = session.getRootNode();
+        // re-fetch testRootNode with read-only session
+        testRootNode = (Node) session.getItem(testRoot);
     }
 
     /**
@@ -172,7 +168,7 @@
      * org.apache.jackrabbit.test.NotExecutableException} is thrown.
      */
     public void testIsMandatory() throws RepositoryException, NotExecutableException {
-        traverse(rootNode);
+        traverse(testRootNode);
         if (!foundMandatoryProperty) {
             throw new NotExecutableException("Workspace does not contain any node with a
mandatory property definition");
         }



Mime
View raw message