jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1752295 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/security/authorization/jackrabbit/acl/AccessControlManagerImplTest.java
Date Tue, 12 Jul 2016 14:05:50 GMT
Author: reschke
Date: Tue Jul 12 14:05:50 2016
New Revision: 1752295

URL: http://svn.apache.org/viewvc?rev=1752295&view=rev
Log:
JCR-3995: occasional test failure in AccessControlManagerImplTest.testAddingFourAccessControlEntries()

improve test diagnostics

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/security/authorization/jackrabbit/acl/AccessControlManagerImplTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/security/authorization/jackrabbit/acl/AccessControlManagerImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/security/authorization/jackrabbit/acl/AccessControlManagerImplTest.java?rev=1752295&r1=1752294&r2=1752295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/security/authorization/jackrabbit/acl/AccessControlManagerImplTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/security/authorization/jackrabbit/acl/AccessControlManagerImplTest.java
Tue Jul 12 14:05:50 2016
@@ -146,27 +146,34 @@ public class AccessControlManagerImplTes
      */
     public void testAddingFourAccessControlEntries() throws Exception {
         try {
-            AccessControlList acl = (AccessControlList) getACL(testRoot);        
-            
+            AccessControlList acl = (AccessControlList) getACL(testRoot);
+
+            // check precondition,see JCR-3995
+            if (testRootNode.hasNode("rep:policy")) {
+                assertEquals("should not have any ace nodes at this point", 0,
+                        testRootNode.getNode("rep:policy").getNodes().getSize());
+            }
+
             acl.addAccessControlEntry(getUnknownPrincipal(), privilegesFromName(Privilege.JCR_READ));
             acl.addAccessControlEntry(getUnknownPrincipal(), privilegesFromName(Privilege.JCR_READ));
             acl.addAccessControlEntry(getUnknownPrincipal(), privilegesFromName(Privilege.JCR_READ));
             acl.addAccessControlEntry(getUnknownPrincipal(), privilegesFromName(Privilege.JCR_READ));
-            
+
             acMgr.setPolicy(testRoot, acl);
 
             // Transient-space: Must contain FOUR ace nodes.
             assertEquals(4, testRootNode.getNode("rep:policy").getNodes().getSize());
-            
+
             superuser.save();
-            
-            // Persistent-state: Must contain a single ace node -> entries were merged
+
+            // Persistent-state: Must contain a single ace node -> entries were
+            // merged
             assertEquals(1, testRootNode.getNode("rep:policy").getNodes().getSize());
         } finally {
             superuser.refresh(false);
         }
     }
-    
+
     /**
      * Test retrieving a policy after a save call.
      * @throws Exception



Mime
View raw message