Index: src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java (revision 430081) +++ src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java (working copy) @@ -358,7 +358,7 @@ } } - protected void tearDown() throws Exception { + protected void cleanUp() throws Exception { if (superuser != null) { try { if (!isReadOnly) { @@ -370,6 +370,10 @@ superuser.logout(); } } + } + + protected void tearDown() throws Exception { + cleanUp(); super.tearDown(); } Index: src/test/java/org/apache/jackrabbit/test/api/AbstractPropertyTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/test/api/AbstractPropertyTest.java (revision 430081) +++ src/test/java/org/apache/jackrabbit/test/api/AbstractPropertyTest.java (working copy) @@ -57,6 +57,7 @@ prop = PropertyUtil.searchProp(session, session.getRootNode().getNode(testPath), getPropertyType()); if (prop == null) { + cleanUp(); String msg = "Workspace does not contain a node with a " + PropertyType.nameFromValue(getPropertyType()) + " property."; throw new NotExecutableException(msg); @@ -64,19 +65,26 @@ multiple = prop.getDefinition().isMultiple(); Value val = PropertyUtil.getValue(prop); if (val == null) { + cleanUp(); String msg = PropertyType.nameFromValue(getPropertyType()) + " property does not contain a value"; throw new NotExecutableException(msg); } } + protected void cleanUp() throws Exception { + if (session != null) { + session.logout(); + } + super.cleanUp(); + } + + /** * Releases the session aquired in {@link #setUp()}. */ protected void tearDown() throws Exception { - if (session != null) { - session.logout(); - } + cleanUp(); super.tearDown(); } }