jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1466401 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
Date Wed, 10 Apr 2013 09:31:31 GMT
Author: angela
Date: Wed Apr 10 09:31:31 2013
New Revision: 1466401

URL: http://svn.apache.org/r1466401
Log:
OAK-527: permissions (wip, fix tests and add comments why they fail)

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java?rev=1466401&r1=1466400&r2=1466401&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
Wed Apr 10 09:31:31 2013
@@ -35,7 +35,7 @@ import org.junit.Test;
 /**
  * Test access control evaluation for version operations.
  */
-@Ignore("OAK-51")
+@Ignore("OAK-168")
 public class VersionManagementTest extends AbstractEvaluationTest {
 
     private static final String SYSTEM = "/jcr:system";
@@ -65,40 +65,35 @@ public class VersionManagementTest exten
 
     @Test
     public void testAddMixVersionable() throws Exception {
-        Node trn = testSession.getNode(path);
-        modify(trn.getPath(), REP_WRITE, true);
-        modify(trn.getPath(), Privilege.JCR_VERSION_MANAGEMENT, false);
+        modify(path, REP_WRITE, true);
+        modify(path, Privilege.JCR_VERSION_MANAGEMENT, false);
 
-        Node n = trn.hasNode(nodeName2) ? trn.getNode(nodeName2) : trn.addNode(nodeName2);
+        Node testNode = testSession.getNode(path);
         try {
-            if (n.canAddMixin(mixVersionable)) {
-                n.addMixin(mixVersionable);
-            } else {
-                throw new NotExecutableException();
-            }
-            testSession.save();
-            fail("Test session does not have write permission in the version storage ->
adding mixin must fail.");
+            createVersionableNode(testNode);
+            fail("Test session does not have permission to add mixins -> no version content
should be created.");
         } catch (AccessDeniedException e) {
             // success
             // ... but autocreated versionable node properties must not be present
-            assertFalse(n.isNodeType(mixVersionable));
-            assertFalse(n.hasProperty("jcr:isCheckedOut"));
-            assertFalse(n.hasProperty(jcrVersionHistory));
+            assertFalse(testNode.isNodeType(mixVersionable));
+            assertFalse(testNode.hasProperty("jcr:isCheckedOut"));
+            assertFalse(testNode.hasProperty(jcrVersionHistory));
         }
     }
 
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testAddMixVersionable2() throws Exception {
-        Node trn = testSession.getNode(path);
-        modify(trn.getPath(), REP_WRITE, true);
-        modify(trn.getPath(), Privilege.JCR_NODE_TYPE_MANAGEMENT, true);
-        modify(trn.getPath(), Privilege.JCR_VERSION_MANAGEMENT, true);
+        modify(path, REP_WRITE, true);
+        modify(path, Privilege.JCR_NODE_TYPE_MANAGEMENT, true);
+        modify(path, Privilege.JCR_VERSION_MANAGEMENT, true);
 
-        Node n = createVersionableNode(trn);
+        Node n = createVersionableNode(testSession.getNode(path));
         n.checkin();
         n.checkout();
     }
 
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testCheckInCheckout() throws Exception {
         modify(path, REP_WRITE, true);
@@ -123,6 +118,7 @@ public class VersionManagementTest exten
     /**
      * @since oak (DIFF: jr required jcr:versionManagement privilege on the version store)
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testRemoveVersion() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
@@ -141,6 +137,7 @@ public class VersionManagementTest exten
     /**
      * @since oak (DIFF: jr required jcr:versionManagement privilege on the version store)
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testRemoveVersion2() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
@@ -166,6 +163,7 @@ public class VersionManagementTest exten
     /**
      * @since oak (DIFF: jr required jcr:versionManagement privilege on the version store)
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testRemoveVersion3() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
@@ -198,6 +196,7 @@ public class VersionManagementTest exten
     /**
      * @since oak
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testAccessVersionContentWithoutStoreAccess() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
@@ -231,6 +230,7 @@ public class VersionManagementTest exten
     /**
      * @since oak (DIFF: jr required jcr:versionManagement privilege on the version store)
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testAccessVersionHistory() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
@@ -253,6 +253,7 @@ public class VersionManagementTest exten
     /**
      * @since oak (DIFF: jr required jcr:versionManagement privilege on the version store)
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testAccessVersionHistoryVersionableNodeNotAccessible() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
@@ -298,6 +299,7 @@ public class VersionManagementTest exten
     /**
      * @since oak
      */
+    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
     @Test
     public void testAddVersionLabel() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));



Mime
View raw message