jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1404622 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java
Date Thu, 01 Nov 2012 14:54:22 GMT
Author: angela
Date: Thu Nov  1 14:54:22 2012
New Revision: 1404622

URL: http://svn.apache.org/viewvc?rev=1404622&view=rev
Log:
OAK-50 : Implement User Management (WIP)

replace PrincipalImpl. thanks marcel for spotting this!

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserManagerImplTest.java

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=1404622&r1=1404621&r2=1404622&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 Nov  1 14:54:22 2012
@@ -36,7 +36,6 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.util.NodeUtil;
 import org.junit.Before;
 import org.junit.Test;
-import sun.security.acl.PrincipalImpl;
 
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertFalse;
@@ -149,7 +148,7 @@ public class UserManagerImplTest extends
         try {
             // authNode - authFolder -> create User
             try {
-                Principal p = new PrincipalImpl("test2");
+                Principal p = new TestPrincipal("test2");
                 Authorizable a = userMgr.createUser(p.getName(), p.getName(), p, path);
                 root.commit();
 
@@ -175,7 +174,7 @@ public class UserManagerImplTest extends
         try {
             // authNode - anyNode -> create User
             try {
-                Principal p = new PrincipalImpl("test3");
+                Principal p = new TestPrincipal("test3");
                 userMgr.createUser(p.getName(), p.getName(), p, path);
                 root.commit();
 
@@ -195,7 +194,7 @@ public class UserManagerImplTest extends
             folder = someContent.addChild("folder", UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
             root.commit(); // this time save node structure
             try {
-                Principal p = new PrincipalImpl("test4");
+                Principal p = new TestPrincipal("test4");
                 userMgr.createUser(p.getName(), p.getName(), p, folder.getTree().getPath());
                 root.commit();
 
@@ -219,4 +218,17 @@ public class UserManagerImplTest extends
             }
         }
     }
+
+    private class TestPrincipal implements Principal {
+
+        private final String name;
+
+        private TestPrincipal(String name) {
+            this.name = name;
+        }
+        @Override
+        public String getName() {
+            return name;
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message