jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r771929 - in /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security: AbstractAccessControlTest.java AccessControlListTest.java TestAll.java
Date Tue, 05 May 2009 17:02:24 GMT
Author: reschke
Date: Tue May  5 17:02:18 2009
New Revision: 771929

URL: http://svn.apache.org/viewvc?rev=771929&view=rev
Log:
JCR-2085: prepare security tests for move to jcr-tests (enable descriptor checking, remove
unneeded casts)

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AbstractAccessControlTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AccessControlListTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/TestAll.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AbstractAccessControlTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AbstractAccessControlTest.java?rev=771929&r1=771928&r2=771929&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AbstractAccessControlTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AbstractAccessControlTest.java
Tue May  5 17:02:18 2009
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.api.jsr283.security;
 
+import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.security.AccessControlManager;
 import javax.jcr.security.Privilege;
 
-import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 
@@ -34,19 +34,15 @@
     protected AccessControlManager acMgr;
 
     protected void setUp() throws Exception {
-        // TODO: uncomment again.
-        // checkSupportedOption(Repository.OPTION_ACCESS_CONTROL_SUPPORTED);
+        checkSupportedOption(Repository.OPTION_ACCESS_CONTROL_SUPPORTED);
+        
         super.setUp();
         acMgr = getAccessControlManager(superuser);
     }
 
     protected static AccessControlManager getAccessControlManager(Session s) throws RepositoryException,
NotExecutableException {
-        // TODO: fix (Replace by Session) test as soon as jackrabbit implements 283
-        if (!(s instanceof SessionImpl)) {
-            throw new NotExecutableException();
-        }
         try {
-            return ((SessionImpl) s).getAccessControlManager();
+            return s.getAccessControlManager();
         } catch (UnsupportedRepositoryOperationException e) {
             throw new NotExecutableException();
         }
@@ -93,8 +89,7 @@
 
     protected String getPathToProperty() throws RepositoryException {
         String path = testRootNode.getPath() + "/" + jcrPrimaryType;
-        // TODO: remove cast to SessionImpl again once 283 is released.
-        if (((SessionImpl) superuser).nodeExists(path)) {
+        if (superuser.nodeExists(path)) {
             throw new RepositoryException("Path " + path + " should point to property.");
         }
         return path;

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AccessControlListTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AccessControlListTest.java?rev=771929&r1=771928&r2=771929&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AccessControlListTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/AccessControlListTest.java
Tue May  5 17:02:18 2009
@@ -27,6 +27,7 @@
 
 import javax.jcr.AccessDeniedException;
 import javax.jcr.Node;
+import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.security.AccessControlEntry;
 import javax.jcr.security.AccessControlException;
@@ -56,8 +57,8 @@
     private List privilegesToRestore = new ArrayList();
 
     protected void setUp() throws Exception {
-        // TODO: test if options is supported
-        //checkSupportedOption(Repository.OPTION_ACCESS_CONTROL_SUPPORTED);
+        checkSupportedOption(Repository.OPTION_ACCESS_CONTROL_SUPPORTED);
+
         super.setUp();
 
         // TODO: make sure, entries to ADD are not present yet.
@@ -163,6 +164,10 @@
             assertTrue("An ACE must contain at least a single privilege", privs != null &&
privs.length > 0);
         }
     }
+    
+    public void testFoo() {
+        throw new RuntimeException("LALALA");
+    }
 
     public void testAddAccessControlEntry() throws NotExecutableException, RepositoryException
{
         checkCanModifyAc(path);

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/TestAll.java?rev=771929&r1=771928&r2=771929&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/security/TestAll.java
Tue May  5 17:02:18 2009
@@ -40,7 +40,7 @@
 
         suite.addTestSuite(AccessControlDiscoveryTest.class);
         suite.addTestSuite(AccessControlPolicyTest.class);
-         suite.addTestSuite(AccessControlPolicyIteratorTest.class);
+        suite.addTestSuite(AccessControlPolicyIteratorTest.class);
         suite.addTestSuite(AccessControlListTest.class);
 
         // tests with read only session:



Mime
View raw message