jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r758640 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
Date Thu, 26 Mar 2009 13:42:58 GMT
Author: angela
Date: Thu Mar 26 13:42:50 2009
New Revision: 758640

URL: http://svn.apache.org/viewvc?rev=758640&view=rev
Log:
JCR-1588: Access Control

tests: missing session.logout

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java?rev=758640&r1=758639&r2=758640&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
Thu Mar 26 13:42:50 2009
@@ -41,6 +41,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         if (!(superuser instanceof JackrabbitSession)) {
+            superuser.logout();
             throw new NotExecutableException();
         }
         principalMgr = ((JackrabbitSession) superuser).getPrincipalManager();
@@ -73,11 +74,16 @@
     }
 
     public void testReadOnlyIsEveryOne() throws RepositoryException {
-        Principal[] pcpls = getPrincipals(helper.getReadOnlySession());
-        for (int i = 0; i < pcpls.length; i++) {
-            if (!(pcpls[i].equals(everyone))) {
-                assertTrue(everyone.isMember(pcpls[i]));
+        Session s = helper.getReadOnlySession();
+        try {
+            Principal[] pcpls = getPrincipals(s);
+            for (int i = 0; i < pcpls.length; i++) {
+                if (!(pcpls[i].equals(everyone))) {
+                    assertTrue(everyone.isMember(pcpls[i]));
+                }
             }
+        } finally {
+            s.logout();
         }
     }
 



Mime
View raw message