jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1431537 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak: security/ security/authentication/ security/authentication/token/ security/authentication/user/ security/principal/ security/user/ security/user/query/ sp...
Date Thu, 10 Jan 2013 18:14:28 GMT
Author: angela
Date: Thu Jan 10 18:14:28 2013
New Revision: 1431537

URL: http://svn.apache.org/viewvc?rev=1431537&view=rev
Log:
security tests: rename admin field to adminSession

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/AbstractSecurityTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/DefaultLoginModuleTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenDefaultLoginModuleTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenLoginModuleTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/AbstractTokenTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/user/UserAuthenticationTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/AbstractSecurityTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/AbstractSecurityTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/AbstractSecurityTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/AbstractSecurityTest.java
Thu Jan 10 18:14:28 2013
@@ -38,7 +38,7 @@ public abstract class AbstractSecurityTe
     private ContentRepository contentRepository;
 
     protected SecurityProvider securityProvider;
-    protected ContentSession admin;
+    protected ContentSession adminSession;
 
     @Before
     public void before() throws Exception {
@@ -47,14 +47,14 @@ public abstract class AbstractSecurityTe
                 .with(getSecurityProvider())
                 .createContentRepository();
 
-        admin = login(getAdminCredentials());
+        adminSession = login(getAdminCredentials());
 
         Configuration.setConfiguration(getConfiguration());
     }
 
     @After
     public void after() throws Exception {
-        admin.close();
+        adminSession.close();
         Configuration.setConfiguration(null);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/DefaultLoginModuleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/DefaultLoginModuleTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/DefaultLoginModuleTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/DefaultLoginModuleTest.java
Thu Jan 10 18:14:28 2013
@@ -104,7 +104,7 @@ public class DefaultLoginModuleTest exte
     public void testAnonymousLogin() throws Exception {
         String anonymousID = UserUtility.getAnonymousId(uc.getConfigurationParameters());
 
-        Root root = admin.getLatestRoot();
+        Root root = adminSession.getLatestRoot();
         UserManager userMgr = uc.getUserManager(root, NamePathMapper.DEFAULT);
 
         // verify initial user-content looks like expected
@@ -127,7 +127,7 @@ public class DefaultLoginModuleTest exte
 
     @Test
     public void testUserLogin() throws Exception {
-        Root root = admin.getLatestRoot();
+        Root root = adminSession.getLatestRoot();
         UserManager userManager = uc.getUserManager(root, NamePathMapper.DEFAULT);
 
         ContentSession cs = null;
@@ -152,7 +152,7 @@ public class DefaultLoginModuleTest exte
 
     @Test
     public void testSelfImpersonation() throws Exception {
-        Root root = admin.getLatestRoot();
+        Root root = adminSession.getLatestRoot();
         UserManager userManager = uc.getUserManager(root, NamePathMapper.DEFAULT);
 
         ContentSession cs = null;
@@ -188,7 +188,7 @@ public class DefaultLoginModuleTest exte
 
     @Test
     public void testInvalidImpersonation() throws Exception {
-        Root root = admin.getLatestRoot();
+        Root root = adminSession.getLatestRoot();
         UserManager userManager = uc.getUserManager(root, NamePathMapper.DEFAULT);
 
         ContentSession cs = null;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenDefaultLoginModuleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenDefaultLoginModuleTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenDefaultLoginModuleTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenDefaultLoginModuleTest.java
Thu Jan 10 18:14:28 2013
@@ -186,7 +186,7 @@ public class TokenDefaultLoginModuleTest
 
     @Test
     public void testValidTokenCredentials() throws Exception {
-        Root root = admin.getLatestRoot();
+        Root root = adminSession.getLatestRoot();
         TokenProvider tp = getSecurityProvider().getAuthenticationConfiguration().getTokenProvider(root);
 
         SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenLoginModuleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenLoginModuleTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenLoginModuleTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/TokenLoginModuleTest.java
Thu Jan 10 18:14:28 2013
@@ -136,7 +136,7 @@ public class TokenLoginModuleTest extend
 
     @Test
     public void testValidTokenCredentials() throws Exception {
-        Root root = admin.getLatestRoot();
+        Root root = adminSession.getLatestRoot();
         TokenProvider tp = getSecurityProvider().getAuthenticationConfiguration().getTokenProvider(root);
 
         SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/AbstractTokenTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/AbstractTokenTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/AbstractTokenTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/token/AbstractTokenTest.java
Thu Jan 10 18:14:28 2013
@@ -40,7 +40,7 @@ public abstract class AbstractTokenTest 
     public void before() throws Exception {
         super.before();
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
         tokenProvider = new TokenProviderImpl(root,
                 ConfigurationParameters.EMPTY,
                 getSecurityProvider().getUserConfiguration());

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/user/UserAuthenticationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/user/UserAuthenticationTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/user/UserAuthenticationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/user/UserAuthenticationTest.java
Thu Jan 10 18:14:28 2013
@@ -58,7 +58,7 @@ public class UserAuthenticationTest exte
     public void before() throws Exception {
         super.before();
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
 
         userId = "testUser";
         userManager = getSecurityProvider().getUserConfiguration().getUserManager(root, NamePathMapper.DEFAULT);
@@ -130,9 +130,9 @@ public class UserAuthenticationTest exte
     @Test
     public void testAuthenticateInvalidImpersonationCredentials() throws Exception {
        List<Credentials> invalid = new ArrayList<Credentials>();
-        invalid.add(new ImpersonationCredentials(new GuestCredentials(), admin.getAuthInfo()));
-        invalid.add(new ImpersonationCredentials(new SimpleCredentials(admin.getAuthInfo().getUserID(),
new char[0]), new TestAuthInfo()));
-        invalid.add(new ImpersonationCredentials(new SimpleCredentials("unknown", new char[0]),
admin.getAuthInfo()));
+        invalid.add(new ImpersonationCredentials(new GuestCredentials(), adminSession.getAuthInfo()));
+        invalid.add(new ImpersonationCredentials(new SimpleCredentials(adminSession.getAuthInfo().getUserID(),
new char[0]), new TestAuthInfo()));
+        invalid.add(new ImpersonationCredentials(new SimpleCredentials("unknown", new char[0]),
adminSession.getAuthInfo()));
         invalid.add(new ImpersonationCredentials(new SimpleCredentials("unknown", new char[0]),
new TestAuthInfo()));
 
         for (Credentials creds : invalid) {
@@ -148,7 +148,7 @@ public class UserAuthenticationTest exte
     @Test
     public void testAuthenticateImpersonationCredentials() throws Exception {
         SimpleCredentials sc = new SimpleCredentials(userId, new char[0]);
-        assertTrue(authentication.authenticate(new ImpersonationCredentials(sc, admin.getAuthInfo())));
+        assertTrue(authentication.authenticate(new ImpersonationCredentials(sc, adminSession.getAuthInfo())));
     }
 
     @Test

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImplTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImplTest.java
Thu Jan 10 18:14:28 2013
@@ -16,11 +16,6 @@
  */
 package org.apache.jackrabbit.oak.security.principal;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -43,6 +38,11 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.spi.security.user.UserConfiguration;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * PrincipalProviderImplTest...
  */
@@ -56,14 +56,14 @@ public class PrincipalProviderImplTest e
     public void before() throws Exception {
         super.before();
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
         userConfig = getSecurityProvider().getUserConfiguration();
         principalProvider = new PrincipalProviderImpl(root, userConfig, NamePathMapper.DEFAULT);
     }
 
     @Test
     public void testGetPrincipals() throws Exception {
-        String adminId = admin.getAuthInfo().getUserID();
+        String adminId = adminSession.getAuthInfo().getUserID();
         Set<? extends Principal> principals = principalProvider.getPrincipals(adminId);
 
         assertNotNull(principals);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java
Thu Jan 10 18:14:28 2013
@@ -58,7 +58,7 @@ public class UserManagerImplTest extends
     public void before() throws Exception {
         super.before();
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
         userMgr = new UserManagerImpl(root, NamePathMapper.DEFAULT, getSecurityProvider());
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserValidatorTest.java
Thu Jan 10 18:14:28 2013
@@ -50,7 +50,7 @@ public class UserValidatorTest extends A
     public void before() throws Exception {
         super.before();
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
         userMgr = new UserManagerImpl(root, NamePathMapper.DEFAULT, getSecurityProvider());
         user = userMgr.createUser("test", "pw");
         root.commit();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java
Thu Jan 10 18:14:28 2013
@@ -56,7 +56,7 @@ public class UserQueryManagerTest extend
         UserConfiguration uc = securityProvider.getUserConfiguration();
         NamePathMapper npMapper = NamePathMapper.DEFAULT;
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
 
         UserManager userMgr = uc.getUserManager(root, npMapper);
         user = userMgr.createUser("testUser", "pw");

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/ExternalLoginModuleTest.java
Thu Jan 10 18:14:28 2013
@@ -63,7 +63,7 @@ public class ExternalLoginModuleTest ext
             ids.add(group.getId());
         }
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
         userManager = securityProvider.getUserConfiguration().getUserManager(root, NamePathMapper.DEFAULT);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java?rev=1431537&r1=1431536&r2=1431537&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/PasswordValidationActionTest.java
Thu Jan 10 18:14:28 2013
@@ -60,10 +60,10 @@ public class PasswordValidationActionTes
     public void before() throws Exception {
         super.before();
 
-        root = admin.getLatestRoot();
+        root = adminSession.getLatestRoot();
 
         userManager = getSecurityProvider().getUserConfiguration().getUserManager(root, NamePathMapper.DEFAULT);
-        user = (User) userManager.getAuthorizable(admin.getAuthInfo().getUserID());
+        user = (User) userManager.getAuthorizable(adminSession.getAuthInfo().getUserID());
 
         testAction.reset();
         pwAction.setConstraint("^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z]).*");



Mime
View raw message