You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by an...@apache.org on 2013/04/11 17:00:50 UTC

svn commit: r1466912 - in /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization: MoveTest.java NodeTypeManagementTest.java

Author: angela
Date: Thu Apr 11 15:00:49 2013
New Revision: 1466912

URL: http://svn.apache.org/r1466912
Log:
OAK-527: permissions (WIP: tests)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/MoveTest.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/MoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/MoveTest.java?rev=1466912&r1=1466911&r2=1466912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/MoveTest.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/MoveTest.java Thu Apr 11 15:00:49 2013
@@ -27,7 +27,7 @@ import org.junit.Test;
 /**
  * MoveTest... TODO
  */
-@Ignore("OAK-51")
+@Ignore("OAK-51 : permission validator doesn't detect move")
 public class MoveTest extends AbstractEvaluationTest {
 
     private String nodePath3;
@@ -137,9 +137,9 @@ public class MoveTest extends AbstractEv
         deny(childNPath, readPrivileges);
 
         assertFalse(testSession.nodeExists(childNPath));
-        assertFalse(testAcMgr.hasPrivileges(childNPath, readPrivileges));
+        assertHasPrivileges(childNPath, readPrivileges, false);
         assertFalse(testSession.nodeExists(nodePath3));
-        assertFalse(testAcMgr.hasPrivileges(nodePath3, readPrivileges));
+        assertHasPrivileges(nodePath3, readPrivileges, false);
 
         // move the ancestor node
         String movedChildNPath = path + "/movedNode";
@@ -152,9 +152,9 @@ public class MoveTest extends AbstractEv
         // the AC-content present on childNode is still enforced both on
         // the node itself and on the subtree.
         assertFalse(testSession.nodeExists(movedChildNPath));
-        assertFalse(testAcMgr.hasPrivileges(movedChildNPath, readPrivileges));
+        assertHasPrivileges(movedChildNPath, readPrivileges, false);
         assertFalse(testSession.nodeExists(movedNode3Path));
-        assertFalse(testAcMgr.hasPrivileges(movedNode3Path, readPrivileges));
+        assertHasPrivileges(movedNode3Path, readPrivileges, false);
     }
 
     @Test
@@ -164,7 +164,7 @@ public class MoveTest extends AbstractEv
         deny(nodePath3, readPrivileges);
 
         assertFalse(testSession.nodeExists(nodePath3));
-        assertFalse(testAcMgr.hasPrivileges(nodePath3, readPrivileges));
+        assertHasPrivileges(nodePath3, readPrivileges, false);
 
         // move the ancestor node
         String movedChildNPath = path + "/movedNode";
@@ -176,7 +176,7 @@ public class MoveTest extends AbstractEv
         // expected behavior:
         // the AC-content present on node3 is still enforced
         assertFalse(testSession.nodeExists(movedNode3Path));
-        assertFalse(testAcMgr.hasPrivileges(movedNode3Path, readPrivileges));
+        assertHasPrivileges(movedNode3Path, readPrivileges, false);
     }
 
     @Test
@@ -197,7 +197,7 @@ public class MoveTest extends AbstractEv
         // expected behavior:
         // due to move node3 should not e visible any more
         assertFalse(testSession.nodeExists(movedPath));
-        assertFalse(testAcMgr.hasPrivileges(movedPath, readPrivileges));
+        assertHasPrivileges(movedPath, readPrivileges, false);
     }
 
     @Test
@@ -207,7 +207,7 @@ public class MoveTest extends AbstractEv
         deny(childNPath, readPrivileges, createGlobRestriction('/' +nodeName3));
 
         assertFalse(testSession.nodeExists(nodePath3));
-        assertFalse(testAcMgr.hasPrivileges(nodePath3, readPrivileges));
+        assertHasPrivileges(nodePath3, readPrivileges, false);
 
         String movedChildNPath = path + "/movedNode";
         String movedNode3Path = movedChildNPath + '/' + nodeName3;
@@ -216,7 +216,7 @@ public class MoveTest extends AbstractEv
         superuser.save();
 
         assertFalse(testSession.nodeExists(movedNode3Path));
-        assertFalse(testAcMgr.hasPrivileges(movedNode3Path, readPrivileges));
+        assertHasPrivileges(movedNode3Path, readPrivileges, false);
     }
 
     @Test
@@ -225,8 +225,7 @@ public class MoveTest extends AbstractEv
         // restriction: remove read priv to nodeName3 node
         deny(childNPath, readPrivileges, createGlobRestriction('/' + nodeName3));
 
-        // don't fill the per-session read-cache by calling Session.nodeExists
-        assertFalse(testAcMgr.hasPrivileges(nodePath3, readPrivileges));
+        assertHasPrivileges(nodePath3, readPrivileges, false);
 
         String movedChildNPath = path + "/movedNode";
         String movedNode3Path = movedChildNPath + '/' + nodeName3;
@@ -235,6 +234,6 @@ public class MoveTest extends AbstractEv
         superuser.save();
 
         assertFalse(testSession.nodeExists(movedNode3Path));
-        assertFalse(testAcMgr.hasPrivileges(movedNode3Path, readPrivileges));
+        assertHasPrivileges(movedNode3Path, readPrivileges, false);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java?rev=1466912&r1=1466911&r2=1466912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java Thu Apr 11 15:00:49 2013
@@ -32,7 +32,7 @@ import org.junit.Test;
 /**
  * NodeTypeManagementTest... TODO
  */
-@Ignore("OAK-51")
+@Ignore("OAK-51 : permission validator doesn't detect changes to mixin/primary type")
 public class NodeTypeManagementTest extends AbstractEvaluationTest {
 
     private Node childNode;
@@ -82,6 +82,7 @@ public class NodeTypeManagementTest exte
         superuser.save();
     }
 
+    @Ignore("OAK-767 : Implement Node#removeMixin")
     @Test
     public void testRemoveMixin() throws Exception {
         ((Node) superuser.getItem(childNode.getPath())).addMixin(mixinName);
@@ -173,7 +174,7 @@ public class NodeTypeManagementTest exte
         Workspace wsp = testSession.getWorkspace();
         String parentPath = childNode.getParent().getPath();
         String srcPath = childNode.getPath();
-        String destPath = parentPath + '/' + nodeName3;
+        String destPath = parentPath + "/destination";
 
         try {
             wsp.copy(srcPath, destPath);
@@ -201,7 +202,7 @@ public class NodeTypeManagementTest exte
         Workspace wsp = testSession.getWorkspace();
         String parentPath = childNode.getParent().getPath();
         String srcPath = childNode.getPath();
-        String destPath = parentPath + '/' + nodeName3;
+        String destPath = parentPath + "/destination";
 
         try {
             wsp.move(srcPath, destPath);
@@ -228,7 +229,7 @@ public class NodeTypeManagementTest exte
     public void testSessionMove() throws Exception {
         String parentPath = childNode.getParent().getPath();
         String srcPath = childNode.getPath();
-        String destPath = parentPath + '/' + nodeName3;
+        String destPath = parentPath + "/destination";
 
         try {
             testSession.move(srcPath, destPath);
@@ -285,6 +286,7 @@ public class NodeTypeManagementTest exte
         testSession.save();
     }
 
+    @Ignore("OAK-773 : Workspace Import XML")
     @Test
     public void testWorkspaceImportXML() throws Exception {
         Workspace wsp = testSession.getWorkspace();