You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2006/08/11 13:22:28 UTC

svn commit: r430758 - /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java

Author: mreutegg
Date: Fri Aug 11 04:22:28 2006
New Revision: 430758

URL: http://svn.apache.org/viewvc?rev=430758&view=rev
Log:
JCR-540: AbstractJCRTest fails on level 1 repositories

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java?rev=430758&r1=430757&r2=430758&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java (original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java Fri Aug 11 04:22:28 2006
@@ -342,11 +342,12 @@
                 // test root is the root node
                 testRootNode = superuser.getRootNode();
             } else if (!superuser.getRootNode().hasNode(testPath)) {
+                cleanUp();
                 fail("Workspace does not contain test data at: " + testRoot);
             } else {
                 testRootNode = superuser.getRootNode().getNode(testPath);
             }
-        } else {
+        } else if (isSupported(Repository.LEVEL_2_SUPPORTED)) {
             testRootNode = cleanUpTestRoot(superuser);
             // also clean second workspace
             Session s = helper.getSuperuserSession(workspaceName);
@@ -355,13 +356,16 @@
             } finally {
                 s.logout();
             }
+        } else {
+            cleanUp();
+            fail("Test case requires level 2 support.");
         }
     }
 
     protected void cleanUp() throws Exception {
         if (superuser != null) {
             try {
-                if (!isReadOnly) {
+                if (!isReadOnly && isSupported(Repository.LEVEL_2_SUPPORTED)) {
                     cleanUpTestRoot(superuser);
                 }
             } catch (Exception e) {