jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r788351 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/HasPermissionTest.java
Date Thu, 25 Jun 2009 13:17:38 GMT
Author: angela
Date: Thu Jun 25 13:17:38 2009
New Revision: 788351

URL: http://svn.apache.org/viewvc?rev=788351&view=rev
Log:
HasPermissionTest: Add missing Session.logout to prevent ERROR in jcr.log


Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/HasPermissionTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/HasPermissionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/HasPermissionTest.java?rev=788351&r1=788350&r2=788351&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/HasPermissionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/HasPermissionTest.java
Thu Jun 25 13:17:38 2009
@@ -41,14 +41,18 @@
         superuser.save();
 
         Session readOnly = helper.getReadOnlySession();
-        String path = n.getPath();
+        try {
+            String path = n.getPath();
 
-        assertTrue(readOnly.hasPermission(path, Session.ACTION_READ));
-        assertFalse(readOnly.hasPermission(path + "newNode", Session.ACTION_ADD_NODE));
-        assertFalse(readOnly.hasPermission(path, Session.ACTION_REMOVE));
-        assertFalse(readOnly.hasPermission(path, Session.ACTION_SET_PROPERTY));
-        assertFalse(readOnly.hasPermission(path, ACTION_ALL));
-        assertFalse(readOnly.hasPermission(path, Session.ACTION_REMOVE + "," + Session.ACTION_SET_PROPERTY));
+            assertTrue(readOnly.hasPermission(path, Session.ACTION_READ));
+            assertFalse(readOnly.hasPermission(path + "newNode", Session.ACTION_ADD_NODE));
+            assertFalse(readOnly.hasPermission(path, Session.ACTION_REMOVE));
+            assertFalse(readOnly.hasPermission(path, Session.ACTION_SET_PROPERTY));
+            assertFalse(readOnly.hasPermission(path, ACTION_ALL));
+            assertFalse(readOnly.hasPermission(path, Session.ACTION_REMOVE + "," + Session.ACTION_SET_PROPERTY));
+        } finally {
+            readOnly.logout();
+        }
     }
 
     /**
@@ -63,12 +67,15 @@
 
         String path = n.getPath();
         Session rwSession = helper.getReadWriteSession();
-
-        assertTrue(rwSession.hasPermission(path, Session.ACTION_READ));
-        assertTrue(rwSession.hasPermission(path + "newNode", Session.ACTION_ADD_NODE));
-        assertTrue(rwSession.hasPermission(path, Session.ACTION_REMOVE));
-        assertTrue(rwSession.hasPermission(path, Session.ACTION_SET_PROPERTY));
-        assertTrue(rwSession.hasPermission(path, ACTION_ALL));
+        try {
+            assertTrue(rwSession.hasPermission(path, Session.ACTION_READ));
+            assertTrue(rwSession.hasPermission(path + "newNode", Session.ACTION_ADD_NODE));
+            assertTrue(rwSession.hasPermission(path, Session.ACTION_REMOVE));
+            assertTrue(rwSession.hasPermission(path, Session.ACTION_SET_PROPERTY));
+            assertTrue(rwSession.hasPermission(path, ACTION_ALL));
+        } finally {
+            rwSession.logout();
+        }
     }
 
 



Mime
View raw message