jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1447199 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlListTest.java
Date Mon, 18 Feb 2013 11:16:37 GMT
Author: angela
Date: Mon Feb 18 11:16:36 2013
New Revision: 1447199

URL: http://svn.apache.org/r1447199
Log:
OAK-51 : Access Control Management (WIP)

annotations

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlListTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlListTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlListTest.java?rev=1447199&r1=1447198&r2=1447199&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlListTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlListTest.java
Mon Feb 18 11:16:36 2013
@@ -25,6 +25,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.security.Privilege;
@@ -51,10 +53,8 @@ import static org.junit.Assert.assertTru
  */
 public abstract class AbstractAccessControlListTest extends AbstractAccessControlTest {
 
-    private final String testPath = "/testPath";
-
     protected String getTestPath() {
-        return testPath;
+        return "/testPath";
     }
 
     protected Principal getTestPrincipal() {
@@ -66,28 +66,29 @@ public abstract class AbstractAccessCont
         return createACL(getTestPath(), Collections.<JackrabbitAccessControlEntry>emptyList(),
namePathMapper);
     }
 
-    protected AbstractAccessControlList createACL(JackrabbitAccessControlEntry... entries)
{
+    protected AbstractAccessControlList createACL(@Nonnull JackrabbitAccessControlEntry...
entries) {
         return createACL(getTestPath(), Lists.newArrayList(entries), namePathMapper);
     }
 
-    protected AbstractAccessControlList createACL(List<JackrabbitAccessControlEntry>
entries) {
+    protected AbstractAccessControlList createACL(@Nonnull List<JackrabbitAccessControlEntry>
entries) {
         return createACL(getTestPath(), entries, namePathMapper);
     }
 
-    protected AbstractAccessControlList createACL(String jcrPath, JackrabbitAccessControlEntry...
entries) {
+    protected AbstractAccessControlList createACL(@Nullable String jcrPath,
+                                                  @Nonnull JackrabbitAccessControlEntry...
entries) {
         return createACL(jcrPath, Lists.newArrayList(entries), namePathMapper);
     }
 
-    protected abstract AbstractAccessControlList createACL(String jcrPath,
-                                                           List<JackrabbitAccessControlEntry>
entries,
-                                                           NamePathMapper namePathMapper);
+    protected abstract AbstractAccessControlList createACL(@Nullable String jcrPath,
+                                                           @Nonnull List<JackrabbitAccessControlEntry>
entries,
+                                                           @Nonnull NamePathMapper namePathMapper);
 
     protected List<JackrabbitAccessControlEntry> createTestEntries() throws RepositoryException
{
         List<JackrabbitAccessControlEntry> entries = new ArrayList<JackrabbitAccessControlEntry>(3);
         for (int i = 0; i < 3; i++) {
             entries.add(new ACE(
-                    new PrincipalImpl("testPrincipal"+i),
-                    new Privilege[] {getPrivilegeManager().getPrivilege(PrivilegeConstants.JCR_READ)},
+                    new PrincipalImpl("testPrincipal" + i),
+                    new Privilege[]{getPrivilegeManager().getPrivilege(PrivilegeConstants.JCR_READ)},
                     true, null));
         }
         return entries;
@@ -137,10 +138,10 @@ public abstract class AbstractAccessCont
         paths.put(null, null);
         paths.put(getTestPath(), getTestPath());
         paths.put("/", "/");
-        String oakPath = '/' + TestNameMapper.TEST_PREFIX +":testPath";
-        String jcrPath = '/' + TestNameMapper.TEST_LOCAL_PREFIX+":testPath";
+        String oakPath = '/' + TestNameMapper.TEST_PREFIX + ":testPath";
+        String jcrPath = '/' + TestNameMapper.TEST_LOCAL_PREFIX + ":testPath";
         paths.put(jcrPath, oakPath);
-        jcrPath = "/{"+ TestNameMapper.TEST_URI+"}testPath";
+        jcrPath = "/{" + TestNameMapper.TEST_URI + "}testPath";
         paths.put(jcrPath, oakPath);
 
         // test if oak-path is properly set.
@@ -162,6 +163,7 @@ public abstract class AbstractAccessCont
         assertEquals(0, acl.size());
         assertTrue(acl.isEmpty());
     }
+
     @Test
     public void testSize() throws RepositoryException {
         AbstractAccessControlList acl = createACL(createTestEntries());



Mime
View raw message