jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1510578 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerTest.java
Date Mon, 05 Aug 2013 16:00:40 GMT
Author: mduerig
Date: Mon Aug  5 16:00:40 2013
New Revision: 1510578

URL: http://svn.apache.org/r1510578
Log:
OAK-938: UserManager does not honour session refresh settings
applied patch with (ignored) test case. credits to antonio sanso for the patch

Modified:
    jackrabbit/oak/trunk/oak-jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1510578&r1=1510577&r2=1510578&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Mon Aug  5 16:00:40 2013
@@ -310,6 +310,7 @@
       org.apache.jackrabbit.core.observation.ShareableNodesTest#testAddShare            
            <!-- OAK-118 workspace support needed -->
       org.apache.jackrabbit.core.observation.ShareableNodesTest#testRemoveShare         
            <!-- OAK-118 workspace support needed -->
       org.apache.jackrabbit.oak.jcr.nodetype.NodeDefinitionTest#testRootType            
            <!-- OAK-901 -->
+      org.apache.jackrabbit.oak.jcr.security.user.UserManagerTest#testGetAuthorizableMultipleSessions
 <!-- OAK-938 -->
     </known.issues>
   </properties>
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerTest.java?rev=1510578&r1=1510577&r2=1510578&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerTest.java
Mon Aug  5 16:00:40 2013
@@ -22,11 +22,13 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import javax.jcr.Credentials;
+import javax.jcr.LoginException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 import javax.jcr.UnsupportedRepositoryOperationException;
 
+import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
 import org.apache.jackrabbit.api.security.user.Group;
@@ -82,6 +84,34 @@ public class UserManagerTest extends Abs
             }
         }
     }
+    
+    @Test
+    public void testGetAuthorizableMultipleSessions() throws LoginException, RepositoryException
{
+        Session adminSession = null;
+        SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
+        credentials.setAttribute("refresh-interval", 0);
+
+        String uid = createUserId();
+        User user = null;
+        try {
+            adminSession = superuser.getRepository().login(credentials);
+            UserManager adminUserManager = ((JackrabbitSession) adminSession).getUserManager();
+
+            user = userMgr.createUser(uid, uid);
+            superuser.save();
+
+            assertNotNull(adminUserManager.getAuthorizable(uid));
+        } finally {
+            if (adminSession != null) {
+                adminSession.logout();
+            }
+            if (user != null) {
+                user.remove();
+            }
+        }
+    }
+    
+    
 
     @Test
     public void testGetAuthorizableByPath() throws RepositoryException, NotExecutableException
{



Mime
View raw message