jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792142 [16/35] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrab...
Date Wed, 08 Jul 2009 13:57:46 GMT
Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java Wed Jul  8 13:57:13 2009
@@ -17,27 +17,27 @@
 package org.apache.jackrabbit.core.nodetype.xml;
 
 import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
 
 import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
-import org.apache.jackrabbit.core.TestRepository;
 import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.PropDef;
 import org.apache.jackrabbit.core.value.InternalValue;
+import org.apache.jackrabbit.core.value.InternalValueFactory;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+import org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl;
+import org.apache.jackrabbit.test.AbstractJCRTest;
 
 import javax.jcr.NamespaceException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 import javax.jcr.version.OnParentVersionAction;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -48,7 +48,7 @@
 /**
  * Test cases for reading and writing node type definition files.
  */
-public class TestAll extends TestCase {
+public class TestAll extends AbstractJCRTest {
 
     /** The dummy test namespace. */
     private static final String TEST_NAMESPACE = "http://www.apache.org/jackrabbit/test";
@@ -79,6 +79,7 @@
      * @throws Exception on initialization errors
      */
     protected void setUp() throws Exception {
+        super.setUp();
         InputStream xml =
             getClass().getClassLoader().getResourceAsStream(TEST_NODETYPES);
 
@@ -117,7 +118,7 @@
      * @param propertyName property name, or <code>null</code>
      * @return property definition
      */
-    private PropDef getProperty(String typeName, String propertyName) {
+    private PropDef getPropDef(String typeName, String propertyName) {
         Name name;
         if (propertyName != null) {
             name = FACTORY.create(TEST_NAMESPACE, propertyName);
@@ -149,7 +150,8 @@
             InternalValue[] values = def.getDefaultValues();
             NamespaceResolver nsResolver = new AdditionalNamespaceResolver(registry);
             NamePathResolver resolver = new DefaultNamePathResolver(nsResolver);
-            return values[index].toJCRValue(resolver).getString();
+            ValueFactoryQImpl factory = new ValueFactoryQImpl(InternalValueFactory.getInstance(), resolver);
+            return factory.createValue(values[index]).getString();
         } catch (RepositoryException e) {
             throw new AssertionFailedError(e.getMessage());
         }
@@ -226,58 +228,52 @@
                 def.getPrimaryItemName());
         assertEquals("itemNodeType propertyDefs",
                 10, def.getPropertyDefs().length);
-        PropDef pdef = getProperty("itemNodeType", null);
+        PropDef pdef = getPropDef("itemNodeType", null);
         assertTrue("itemNodeType wildcard property", pdef.definesResidual());
     }
 
     /** Test for namespace registration on node type import. */
     public void testImportXMLNodeTypes() throws Exception {
-        Session session = TestRepository.getInstance().login();
         try {
-            session.getNamespacePrefix("test-namespace2");
+            superuser.getNamespacePrefix("test-namespace2");
             // Ignore test case, node type and namespace already registered
         } catch (NamespaceException e1) {
             // Namespace testns2 not yet registered
             JackrabbitNodeTypeManager ntm = (JackrabbitNodeTypeManager)
-                session.getWorkspace().getNodeTypeManager();
+                superuser.getWorkspace().getNodeTypeManager();
             ntm.registerNodeTypes(
                     TestAll.class.getResourceAsStream(TEST_NS_XML_NODETYPES),
                     JackrabbitNodeTypeManager.TEXT_XML);
             try {
-                session.getNamespacePrefix("test-namespace2");
+                superuser.getNamespacePrefix("test-namespace2");
             } catch (NamespaceException e2) {
                 fail("xml test2 namespace not registered");
             }
-        } finally {
-            session.logout();
         }
     }
 
     /** Test for namespace registration on node type import. */
     public void testImportCNDNodeTypes() throws Exception {
-        Session session = TestRepository.getInstance().login();
         try {
-            session.getNamespacePrefix("test-namespace3");
+            superuser.getNamespacePrefix("test-namespace3");
             // Ignore test case, node type and namespace already registered
         } catch (NamespaceException e1) {
             JackrabbitNodeTypeManager ntm = (JackrabbitNodeTypeManager)
-                session.getWorkspace().getNodeTypeManager();
+                superuser.getWorkspace().getNodeTypeManager();
             ntm.registerNodeTypes(
                     TestAll.class.getResourceAsStream(TEST_NS_CND_NODETYPES),
                     JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
             try {
-                session.getNamespacePrefix("test-namespace3");
+                superuser.getNamespacePrefix("test-namespace3");
             } catch (NamespaceException e2) {
                 fail("cnd test3 namespace not registered");
             }
-        } finally {
-            session.logout();
         }
     }
 
     /** Test for the empty item definition. */
     public void testEmptyItem() {
-        PropDef def = getProperty("itemNodeType", "emptyItem");
+        PropDef def = getPropDef("itemNodeType", "emptyItem");
         assertEquals("emptyItem autoCreate",
                 false, def.isAutoCreated());
         assertEquals("emptyItem mandatory",
@@ -290,56 +286,56 @@
 
     /** Test for the <code>autoCreated</code> item definition attribute. */
     public void testAutoCreateItem() {
-        PropDef def = getProperty("itemNodeType", "autoCreatedItem");
+        PropDef def = getPropDef("itemNodeType", "autoCreatedItem");
         assertEquals("autoCreatedItem autoCreated",
                 true, def.isAutoCreated());
     }
 
     /** Test for the <code>mandatory</code> item definition attribute. */
     public void testMandatoryItem() {
-        PropDef def = getProperty("itemNodeType", "mandatoryItem");
+        PropDef def = getPropDef("itemNodeType", "mandatoryItem");
         assertEquals("mandatoryItem mandatory",
                 true, def.isMandatory());
     }
 
     /** Test for the <code>copy</code> parent version action. */
     public void testCopyItem() {
-        PropDef def = getProperty("itemNodeType", "copyItem");
+        PropDef def = getPropDef("itemNodeType", "copyItem");
         assertEquals("copyItem onParentVersion",
                 OnParentVersionAction.COPY, def.getOnParentVersion());
     }
 
     /** Test for the <code>version</code> parent version action. */
     public void testVersionItem() {
-        PropDef def = getProperty("itemNodeType", "versionItem");
+        PropDef def = getPropDef("itemNodeType", "versionItem");
         assertEquals("versionItem onParentVersion",
                 OnParentVersionAction.VERSION, def.getOnParentVersion());
     }
 
     /** Test for the <code>initialize</code> parent version action. */
     public void testInitializeItem() {
-        PropDef def = getProperty("itemNodeType", "initializeItem");
+        PropDef def = getPropDef("itemNodeType", "initializeItem");
         assertEquals("initializeItem onParentVersion",
                 OnParentVersionAction.INITIALIZE, def.getOnParentVersion());
     }
 
     /** Test for the <code>compute</code> parent version action. */
     public void testComputeItem() {
-        PropDef def = getProperty("itemNodeType", "computeItem");
+        PropDef def = getPropDef("itemNodeType", "computeItem");
         assertEquals("computeItem onParentVersion",
                 OnParentVersionAction.COMPUTE, def.getOnParentVersion());
     }
 
     /** Test for the <code>abort</code> parent version action. */
     public void testAbortItem() {
-        PropDef def = getProperty("itemNodeType", "abortItem");
+        PropDef def = getPropDef("itemNodeType", "abortItem");
         assertEquals("abortItem onParentVersion",
                 OnParentVersionAction.ABORT, def.getOnParentVersion());
     }
 
     /** Test for the <code>protected</code> item definition attribute. */
     public void testProtectedItem() {
-        PropDef def = getProperty("itemNodeType", "protectedItem");
+        PropDef def = getPropDef("itemNodeType", "protectedItem");
         assertEquals("protectedItem protected",
                 true, def.isProtected());
     }
@@ -348,12 +344,12 @@
     public void testPropertyNodeType() {
         NodeTypeDef def = getNodeType("propertyNodeType");
         assertEquals("propertyNodeType propertyDefs",
-                11, def.getPropertyDefs().length);
+                13, def.getPropertyDefs().length);
     }
 
     /** Test for the empty property definition. */
     public void testEmptyProperty() {
-        PropDef def = getProperty("propertyNodeType", "emptyProperty");
+        PropDef def = getPropDef("propertyNodeType", "emptyProperty");
         assertEquals("emptyProperty requiredType",
                 PropertyType.UNDEFINED, def.getRequiredType());
         assertEquals("emptyProperty multiple",
@@ -366,28 +362,28 @@
 
     /** Test for the <code>binary</code> property definition type. */
     public void testBinaryProperty() {
-        PropDef def = getProperty("propertyNodeType", "binaryProperty");
+        PropDef def = getPropDef("propertyNodeType", "binaryProperty");
         assertEquals("binaryProperty requiredType",
                 PropertyType.BINARY, def.getRequiredType());
         assertEquals("binaryProperty valueConstraints",
                 1, def.getValueConstraints().length);
         assertEquals("binaryProperty valueConstraints[0]",
-                "[0,)", (def.getValueConstraints())[0].getDefinition());
+                "[0,)", (def.getValueConstraints())[0].getString());
         assertEquals("binaryProperty defaultValues",
                 0, def.getDefaultValues().length);
     }
 
     /** Test for the <code>boolean</code> property definition type. */
     public void testBooleanProperty() {
-        PropDef def = getProperty("propertyNodeType", "booleanProperty");
+        PropDef def = getPropDef("propertyNodeType", "booleanProperty");
         assertEquals("booleanProperty requiredType",
                 PropertyType.BOOLEAN, def.getRequiredType());
         assertEquals("booleanProperty valueConstraints",
                 2, def.getValueConstraints().length);
         assertEquals("booleanProperty valueConstraints[0]",
-                "true", (def.getValueConstraints())[0].getDefinition());
+                "true", (def.getValueConstraints())[0].getString());
         assertEquals("booleanProperty valueConstraints[1]",
-                "false", (def.getValueConstraints())[1].getDefinition());
+                "false", (def.getValueConstraints())[1].getString());
         assertEquals("booleanProperty defaultValues",
                 1, def.getDefaultValues().length);
         assertEquals("booleanProperty defaultValues[0]",
@@ -396,14 +392,14 @@
 
     /** Test for the <code>date</code> property definition type. */
     public void testDateProperty() {
-        PropDef def = getProperty("propertyNodeType", "dateProperty");
+        PropDef def = getPropDef("propertyNodeType", "dateProperty");
         assertEquals("dateProperty requiredType",
                 PropertyType.DATE, def.getRequiredType());
         assertEquals("dateProperty valueConstraints",
                 1, def.getValueConstraints().length);
         assertEquals("dateProperty valueConstraints[0]",
                 "[2005-01-01T00:00:00.000Z,2006-01-01T00:00:00.000Z)",
-                (def.getValueConstraints())[0].getDefinition());
+                (def.getValueConstraints())[0].getString());
         assertEquals("dateProperty defaultValues",
                 1, def.getDefaultValues().length);
         assertEquals("dateProperty defaultValues[0]",
@@ -412,17 +408,17 @@
 
     /** Test for the <code>double</code> property definition type. */
     public void testDoubleProperty() {
-        PropDef def = getProperty("propertyNodeType", "doubleProperty");
+        PropDef def = getPropDef("propertyNodeType", "doubleProperty");
         assertEquals("doubleProperty requiredType",
                 PropertyType.DOUBLE, def.getRequiredType());
         assertEquals("doubleProperty valueConstraints",
                 3, def.getValueConstraints().length);
         assertEquals("doubleProperty valueConstraints[0]",
-                "[,0.0)", (def.getValueConstraints())[0].getDefinition());
+                "[,0.0)", (def.getValueConstraints())[0].getString());
         assertEquals("doubleProperty valueConstraints[1]",
-                "(1.0,2.0)", (def.getValueConstraints())[1].getDefinition());
+                "(1.0,2.0)", (def.getValueConstraints())[1].getString());
         assertEquals("doubleProperty valueConstraints[2]",
-                "(3.0,]", (def.getValueConstraints())[2].getDefinition());
+                "(3.0,]", (def.getValueConstraints())[2].getString());
         assertEquals("doubleProperty defaultValues",
                 1, def.getDefaultValues().length);
         assertEquals("doubleProperty defaultValues[0]",
@@ -431,17 +427,17 @@
 
     /** Test for the <code>long</code> property definition type. */
     public void testLongProperty() {
-        PropDef def = getProperty("propertyNodeType", "longProperty");
+        PropDef def = getPropDef("propertyNodeType", "longProperty");
         assertEquals("longProperty requiredType",
                 PropertyType.LONG, def.getRequiredType());
         assertEquals("longProperty valueConstraints",
                 3, def.getValueConstraints().length);
         assertEquals("longProperty valueConstraints[0]",
-                "(-10,0]", (def.getValueConstraints())[0].getDefinition());
+                "(-10,0]", (def.getValueConstraints())[0].getString());
         assertEquals("longProperty valueConstraints[1]",
-                "[1,2]", (def.getValueConstraints())[1].getDefinition());
+                "[1,2]", (def.getValueConstraints())[1].getString());
         assertEquals("longProperty valueConstraints[2]",
-                "[10,100)", (def.getValueConstraints())[2].getDefinition());
+                "[10,100)", (def.getValueConstraints())[2].getString());
         assertEquals("longProperty defaultValues",
                 1, def.getDefaultValues().length);
         assertEquals("longProperty defaultValues[0]",
@@ -450,14 +446,14 @@
 
     /** Test for the <code>name</code> property definition type. */
     public void testNameProperty() {
-        PropDef def = getProperty("propertyNodeType", "nameProperty");
+        PropDef def = getPropDef("propertyNodeType", "nameProperty");
         assertEquals("nameProperty requiredType",
                 PropertyType.NAME, def.getRequiredType());
         assertEquals("nameProperty valueConstraints",
                 1, def.getValueConstraints().length);
         assertEquals("nameProperty valueConstraints[0]",
-                "test:testName",
-                (def.getValueConstraints())[0].getDefinition());
+                "{http://www.apache.org/jackrabbit/test}testName",
+                (def.getValueConstraints())[0].getString());
         assertEquals("nameProperty defaultValues",
                 1, def.getDefaultValues().length);
         assertEquals("nameProperty defaultValues[0]",
@@ -466,42 +462,70 @@
 
     /** Test for the <code>path</code> property definition type. */
     public void testPathProperty() {
-        PropDef def = getProperty("propertyNodeType", "pathProperty");
+        PropDef def = getPropDef("propertyNodeType", "pathProperty");
         assertEquals("pathProperty requiredType",
                 PropertyType.PATH, def.getRequiredType());
         assertEquals("pathProperty valueConstraints",
                 1, def.getValueConstraints().length);
         assertEquals("pathProperty valueConstraints[0]",
-                "/test:testPath",
-                (def.getValueConstraints())[0].getDefinition());
+                "{}\t{http://www.apache.org/jackrabbit/test}testPath",
+                (def.getValueConstraints())[0].getString());
+        assertEquals("pathProperty defaultValues",
+                0, def.getDefaultValues().length);
+    }
+
+    /** Test for the <code>path</code> property definition type. */
+    public void testPathProperty1() {
+        PropDef def = getPropDef("propertyNodeType", "pathProperty1");
+        assertEquals("pathProperty requiredType",
+                PropertyType.PATH, def.getRequiredType());
+        assertEquals("pathProperty valueConstraints",
+                1, def.getValueConstraints().length);
+        assertEquals("pathProperty valueConstraints[0]",
+                "{}\t{http://www.apache.org/jackrabbit/test}testPath\t{}*",
+                (def.getValueConstraints())[0].getString());
+        assertEquals("pathProperty defaultValues",
+                0, def.getDefaultValues().length);
+    }
+
+    /** Test for the <code>path</code> property definition type. */
+    public void testPathProperty2() {
+        PropDef def = getPropDef("propertyNodeType", "pathProperty2");
+        assertEquals("pathProperty requiredType",
+                PropertyType.PATH, def.getRequiredType());
+        assertEquals("pathProperty valueConstraints",
+                1, def.getValueConstraints().length);
+        assertEquals("pathProperty valueConstraints[0]",
+                "{http://www.apache.org/jackrabbit/test}testPath\t{}*",
+                (def.getValueConstraints())[0].getString());
         assertEquals("pathProperty defaultValues",
                 0, def.getDefaultValues().length);
     }
 
     /** Test for the <code>reference</code> property definition type. */
     public void testReferenceProperty() {
-        PropDef def = getProperty("propertyNodeType", "referenceProperty");
+        PropDef def = getPropDef("propertyNodeType", "referenceProperty");
         assertEquals("referenceProperty requiredType",
                 PropertyType.REFERENCE, def.getRequiredType());
         assertEquals("referenceProperty valueConstraints",
                 1, def.getValueConstraints().length);
         assertEquals("referenceProperty valueConstraints[0]",
-                "nt:base",
-                (def.getValueConstraints())[0].getDefinition());
+                "{http://www.jcp.org/jcr/nt/1.0}base",
+                (def.getValueConstraints())[0].getString());
         assertEquals("referenceProperty defaultValues",
                 0, def.getDefaultValues().length);
     }
 
     /** Test for the <code>string</code> property definition type. */
     public void testStringProperty() {
-        PropDef def = getProperty("propertyNodeType", "stringProperty");
+        PropDef def = getPropDef("propertyNodeType", "stringProperty");
         assertEquals("stringProperty requiredType",
                 PropertyType.STRING, def.getRequiredType());
         assertEquals("stringProperty valueConstraints",
                 1, def.getValueConstraints().length);
         assertEquals("stringProperty valueConstraints[0]",
                 "bananas?",
-                (def.getValueConstraints())[0].getDefinition());
+                (def.getValueConstraints())[0].getString());
         assertEquals("stringProperty defaultValues",
                 2, def.getDefaultValues().length);
         assertEquals("stringProperty defaultValues[0]",
@@ -512,7 +536,7 @@
 
     /** Test for the <code>multiple</code> property definition attribute. */
     public void testMultipleProperty() {
-        PropDef def = getProperty("propertyNodeType", "multipleProperty");
+        PropDef def = getPropDef("propertyNodeType", "multipleProperty");
         assertEquals("multipleProperty multiple",
                 true, def.isMultiple());
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/ShareableNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/ShareableNodesTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/ShareableNodesTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/ShareableNodesTest.java Wed Jul  8 13:57:13 2009
@@ -87,6 +87,6 @@
     }
 
     protected void removeFromSharedSet(Node node) throws RepositoryException {
-        ((NodeImpl) node).removeShare();
+        node.removeShare();
     }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/VersionEventsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/VersionEventsTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/VersionEventsTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/observation/VersionEventsTest.java Wed Jul  8 13:57:13 2009
@@ -178,7 +178,7 @@
         n1.addMixin(mixVersionable);
         testRootNode.save();
 
-        Session s = helper.getReadOnlySession(workspaceName);
+        Session s = getHelper().getReadOnlySession(workspaceName);
         try {
             EventResult listener = new EventResult(log);
             ObservationManager obsMgr = s.getWorkspace().getObservationManager();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractIndexingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractIndexingTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractIndexingTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractIndexingTest.java Wed Jul  8 13:57:13 2009
@@ -33,7 +33,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        session = helper.getSuperuserSession(WORKSPACE_NAME);
+        session = getHelper().getSuperuserSession(WORKSPACE_NAME);
         testRootNode = cleanUpTestRoot(session);
         // overwrite query manager
         qm = session.getWorkspace().getQueryManager();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java Wed Jul  8 13:57:13 2009
@@ -49,7 +49,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         qm = superuser.getWorkspace().getQueryManager();
-        qomFactory = ((QueryManagerImpl) qm).getQOMFactory();
+        qomFactory = qm.getQOMFactory();
     }
 
     protected void tearDown() throws Exception {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/DerefTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/DerefTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/DerefTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/DerefTest.java Wed Jul  8 13:57:13 2009
@@ -137,6 +137,17 @@
                 new Node[]{microsoft});
     }
 
+    public void testDerefInPredicate() throws RepositoryException {
+        executeXPathQuery(testPath + "/people//*[jcr:deref(@worksfor, '*')/@ceo='McNealy']",
+                new Node[]{andrew, eric});
+
+        executeXPathQuery("//*[people/jcr:deref(@worksfor, '*')/@ceo='McNealy']",
+                new Node[]{testRootNode});
+
+//        executeXPathQuery("//*[jcr:contains(people/jcr:deref(@worksfor, '*'),'ballmer')]",
+//                new Node[]{testRootNode});
+    }
+
     /**
      * Checks if jcr:deref works when dereferencing into the version storage.
      */

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/IndexFormatVersionTest.java Wed Jul  8 13:57:13 2009
@@ -45,7 +45,7 @@
     private void checkIndexFormatVersion(String wspName,
                                          IndexFormatVersion version)
             throws RepositoryException {
-        Session session = helper.getSuperuserSession(wspName);
+        Session session = getHelper().getSuperuserSession(wspName);
         try {
             QueryManager qm = session.getWorkspace().getQueryManager();
             QueryHandler handler = ((QueryManagerImpl) qm).getQueryHandler();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/MixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/MixinTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/MixinTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/MixinTest.java Wed Jul  8 13:57:13 2009
@@ -34,10 +34,10 @@
 
         JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
             superuser.getWorkspace().getNodeTypeManager();
-        if (!manager.hasNodeType("test:referenceable")) {
+        if (!manager.hasNodeType("test:mimeType")) {
             String cnd =
                 "<test='http://www.apache.org/jackrabbit/test'>\n"
-                + "[test:referenceable] > mix:referenceable mixin";
+                + "[test:mimeType] > mix:mimeType mixin";
             manager.registerNodeTypes(
                     new ByteArrayInputStream(cnd.getBytes()),
                     JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
@@ -45,7 +45,7 @@
     }
 
     public void testBuiltInMixin() throws RepositoryException {
-        // nt:resoure is referenceable by its node type definition
+        // nt:resource is mix:mimeType by its node type definition
         Node n1 = testRootNode.addNode("n1", "nt:resource");
         n1.setProperty("jcr:data", new ByteArrayInputStream("hello world".getBytes()));
         n1.setProperty("jcr:lastModified", Calendar.getInstance());
@@ -53,15 +53,15 @@
 
         // assign mix:referenceable to arbitrary node
         Node n2 = testRootNode.addNode("n2");
-        n2.addMixin("mix:referenceable");
+        n2.addMixin("mix:mimeType");
 
-        // make node referenceable using a mixin that extends from mix:referenceable
+        // make node referenceable using a mixin that extends from mix:mimeType
         Node n3 = testRootNode.addNode("n3");
-        n3.addMixin("test:referenceable");
+        n3.addMixin("test:mimeType");
 
         testRootNode.save();
 
-        String query = testPath + "//element(*, mix:referenceable)";
+        String query = testPath + "//element(*, mix:mimeType)";
         executeXPathQuery(query, new Node[]{n1, n2, n3});
     }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ShareableNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ShareableNodeTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ShareableNodeTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ShareableNodeTest.java Wed Jul  8 13:57:13 2009
@@ -66,7 +66,7 @@
         assertTrue("wrong node", n4.isSame(nodes.nextNode()));
 
         // remove a node from the shared set
-        ((NodeImpl) s).removeShare();
+        s.removeShare();
         testRootNode.save();
 
         s = n2.getNode(nodeName3);
@@ -88,7 +88,7 @@
         assertTrue("wrong node", s.isSame(nodes.nextNode()));
 
         // remove remaining node from the shared set
-        ((NodeImpl) s).removeShare();
+        s.removeShare();
         testRootNode.save();
 
         stmt = testPath + "/" + nodeName1 + "/*[@" + propertyName1 + "='value']";
@@ -127,7 +127,7 @@
         assertTrue("wrong node", s.isSame(nodes.nextNode()));
 
         // remove a node from the shared set
-        ((NodeImpl) s).removeShare();
+        s.removeShare();
         testRootNode.save();
 
         s = n2.getNode(nodeName4);
@@ -143,7 +143,7 @@
         assertTrue("wrong node", s.isSame(nodes.nextNode()));
 
         // remove remaining node from the shared set
-        ((NodeImpl) s).removeShare();
+        s.removeShare();
         testRootNode.save();
 
         stmt = testPath + "//" + nodeName3;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeletedNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeletedNodesTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeletedNodesTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeletedNodesTest.java Wed Jul  8 13:57:13 2009
@@ -37,7 +37,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        s2 = helper.getSuperuserSession();
+        s2 = getHelper().getSuperuserSession();
         qm = s2.getWorkspace().getQueryManager();
     }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeniedNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeniedNodesTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeniedNodesTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SkipDeniedNodesTest.java Wed Jul  8 13:57:13 2009
@@ -32,7 +32,7 @@
 import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;
 
@@ -51,7 +51,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        anonymous = helper.getReadOnlySession();
+        anonymous = getHelper().getReadOnlySession();
 
         n1 = testRootNode.addNode(nodeName1);
         n1.setProperty(propertyName1, "a");

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java Wed Jul  8 13:57:13 2009
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query;
 
 import org.apache.jackrabbit.core.query.lucene.hits.ArrayHitsTest;
+import org.apache.jackrabbit.test.ConcurrentTestSuite;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -35,7 +36,7 @@
      *         package.
      */
     public static Test suite() {
-        TestSuite suite = new TestSuite("Search tests");
+        TestSuite suite = new ConcurrentTestSuite("Search tests");
 
         suite.addTestSuite(SimpleQueryTest.class);
         suite.addTestSuite(FulltextQueryTest.class);
@@ -56,10 +57,10 @@
         suite.addTestSuite(SynonymProviderTest.class);
         suite.addTestSuite(ArrayHitsTest.class);
         suite.addTestSuite(ExcerptTest.class);
-        suite.addTestSuite(IndexingAggregateTest.class);
         suite.addTestSuite(IndexFormatVersionTest.class);
         suite.addTestSuite(IndexingRuleTest.class);
         suite.addTestSuite(ShareableNodeTest.class);
+        suite.addTestSuite(ParentNodeTest.class);
 
         return suite;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingQueueTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingQueueTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingQueueTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingQueueTest.java Wed Jul  8 13:57:13 2009
@@ -113,7 +113,7 @@
         Thread t = new Thread(new Runnable() {
             public void run() {
                 try {
-                    session = helper.getSuperuserSession(WORKSPACE_NAME);
+                    session = getHelper().getSuperuserSession(WORKSPACE_NAME);
                 } catch (RepositoryException e) {
                     throw new RuntimeException(e);
                 }
@@ -147,7 +147,7 @@
             }
         }
 
-        String stmt = testPath + "//element(*, nt:resource)[jcr:contains(., 'fox')]";
+        String stmt = testPath + "//element(*, nt:resource)[jcr:contains(., 'fox')] order by @jcr:score descending";
         Query q = qm.createQuery(stmt, Query.XPATH);
         assertEquals(num, q.execute().getNodes().getSize());
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/SlowQueryHandler.java Wed Jul  8 13:57:13 2009
@@ -18,56 +18,31 @@
 
 import java.io.IOException;
 
-import javax.jcr.RepositoryException;
-import javax.jcr.query.InvalidQueryException;
-
-import org.apache.jackrabbit.core.query.AbstractQueryHandler;
-import org.apache.jackrabbit.core.query.ExecutableQuery;
-import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.ItemManager;
-import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
 import org.apache.jackrabbit.uuid.UUID;
 
 /**
  * <code>SlowQueryHandler</code> implements a dummy query handler for testing
  * purpose.
  */
-public class SlowQueryHandler extends AbstractQueryHandler {
+public class SlowQueryHandler extends SearchIndex {
+
+    private static long INITIALIZATION_DELAY = 0;
 
     protected void doInit() throws IOException {
         // sleep for 10 seconds then try to read from the item state manager
         // the repository.xml is configured with a 5 second maxIdleTime
         try {
-            Thread.sleep(10 * 1000);
+            Thread.sleep(INITIALIZATION_DELAY);
         } catch (InterruptedException e) {
             // ignore
         }
         NodeId id = new NodeId(UUID.randomUUID());
         getContext().getItemStateManager().hasItemState(id);
+        super.doInit();
     }
 
-    public void addNode(NodeState node) throws RepositoryException, IOException {
-    }
-
-    public void deleteNode(NodeId id) throws IOException {
-    }
-
-    public void close() throws IOException {
-    }
-
-    public ExecutableQuery createExecutableQuery(SessionImpl session,
-                                                 ItemManager itemMgr, String statement,
-                                                 String language)
-            throws InvalidQueryException {
-        return null;
-    }
-
-    public ExecutableQuery createExecutableQuery(SessionImpl session,
-                                                 ItemManager itemMgr,
-                                                 QueryObjectModelTree qomTree)
-            throws InvalidQueryException {
-        return null;
+    public static void setInitializationDelay(long delay) {
+        INITIALIZATION_DELAY = delay;
     }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java Wed Jul  8 13:57:13 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import org.apache.jackrabbit.test.ConcurrentTestSuite;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -33,9 +34,11 @@
      *         package.
      */
     public static Test suite() {
-        TestSuite suite = new TestSuite("Search tests");
+        TestSuite suite = new ConcurrentTestSuite("Search tests");
 
         suite.addTestSuite(IndexingQueueTest.class);
+        suite.addTestSuite(DecimalConvertTest.class);
+        suite.addTestSuite(IndexingAggregateTest.class);
 
         return suite;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/retention/AbstractRetentionTest.java Wed Jul  8 13:57:13 2009
@@ -12,14 +12,13 @@
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
- * limitations under the Licenseorg.apache.jackrabbit.core.retentionjsr283.retention;
-*/
+ * limitations under the License.
+ */
 package org.apache.jackrabbit.core.retention;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.retention.RetentionPolicy;
 
-import org.apache.jackrabbit.core.retention.RetentionPolicyImpl;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/AccessManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/AccessManagerTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/AccessManagerTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/AccessManagerTest.java Wed Jul  8 13:57:13 2009
@@ -27,6 +27,7 @@
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,9 +36,12 @@
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.NoSuchWorkspaceException;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.List;
 
 /**
  * <code>AccessManagerTest</code>...
@@ -66,7 +70,7 @@
     // TODO: add specific tests for 'AC-read/modify' privileges
 
     public void testCheckPermissionReadOnlySession() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             AccessManager acMgr = getAccessManager(s);
 
@@ -109,24 +113,22 @@
         acMgr.checkPermission(id, AccessManager.READ | AccessManager.WRITE | AccessManager.REMOVE  + 1);
     }
 
-/*
-// TODO: uncomment as soon as SimpleAccessManager is replaced
     public void testCheckPermissionWithUnknowId() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
-        AccessManager acMgr = getAccessManager(s);
-
+        Session s = getHelper().getReadOnlySession();
         NodeId id = new NodeId(UUID.randomUUID());
         try {
+            AccessManager acMgr = getAccessManager(s);
             acMgr.checkPermission(id, AccessManager.READ);
             fail("AccessManager.checkPermission should throw ItemNotFoundException with a random (unknown) item id.");
         } catch (ItemNotFoundException e) {
             // ok
+        } finally {
+            s.logout();
         }
     }
-*/
 
     public void testIsGranted() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             AccessManager acMgr = getAccessManager(s);
 
@@ -140,7 +142,7 @@
     }
 
     public void testIsGrantedOnProperty() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             AccessManager acMgr = getAccessManager(s);
 
@@ -155,7 +157,7 @@
     }
 
     public void testIsGrantedOnNewNode() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadWriteSession();
+        Session s = getHelper().getReadWriteSession();
         try {
             AccessManager acMgr = getAccessManager(s);
 
@@ -171,7 +173,7 @@
     }
 
     public void testCanAccess() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             String wspName = s.getWorkspace().getName();
 
@@ -182,7 +184,7 @@
     }
 
     public void testCanAccessAllAvailable() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             String[] wspNames = s.getWorkspace().getAccessibleWorkspaceNames();
             for (int i = 0; i < wspNames.length; i++) {
@@ -194,7 +196,7 @@
     }
 
     public void testCanAccessDeniedWorkspace() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             Set allAccessibles = new HashSet(Arrays.asList(superuser.getWorkspace().getAccessibleWorkspaceNames()));
             Set sWorkspaceNames = new HashSet(Arrays.asList(s.getWorkspace().getAccessibleWorkspaceNames()));
@@ -210,24 +212,23 @@
         }
     }
 
-/*
-// TODO: uncomment as soon as SimpleAccessManager is replaced
     public void testCanAccessNotExistingWorkspace() throws RepositoryException, NotExecutableException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
-        List all = Arrays.asList(s.getWorkspace().getAccessibleWorkspaceNames());
-        String testName = "anyWorkspace";
-        int i = 0;
-        while (all.contains(testName)) {
-            testName = "anyWorkspace" + i;
-            i++;
-        }
-        assertFalse(getAccessManager(s).canAccess(testName));
+            List all = Arrays.asList(s.getWorkspace().getAccessibleWorkspaceNames());
+            String testName = "anyWorkspace";
+            int i = 0;
+            while (all.contains(testName)) {
+                testName = "anyWorkspace" + i;
+                i++;
+            }
+            assertFalse(getAccessManager(s).canAccess(testName));
+        } catch (NoSuchWorkspaceException e) {
+            // fine as well.
         } finally {
-        s.logout();
+            s.logout();
         }
     }
-*/
 
     public void testIsGrantedWithRelativePath() throws NotExecutableException {
         AccessManager acMgr = getAccessManager(superuser);
@@ -260,7 +261,7 @@
     }
 
     public void testIsGrantedReadOnlySession() throws NotExecutableException, RepositoryException {
-        Session s = helper.getReadOnlySession();
+        Session s = getHelper().getReadOnlySession();
         try {
             AccessManager acMgr = getAccessManager(s);
             Path p = PathFactoryImpl.getInstance().getRootPath();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/GuestLoginTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/GuestLoginTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/GuestLoginTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/GuestLoginTest.java Wed Jul  8 13:57:13 2009
@@ -29,7 +29,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        guest = helper.getRepository().login(new GuestCredentials());
+        guest = getHelper().getRepository().login(new GuestCredentials());
     }
 
     protected void tearDown() throws Exception {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/NullLoginTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/NullLoginTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/NullLoginTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/NullLoginTest.java Wed Jul  8 13:57:13 2009
@@ -25,8 +25,8 @@
 public class NullLoginTest extends AbstractJCRTest {
 
     public void testNullLogin() throws RepositoryException {
-        Session s = helper.getRepository().login();
-        Session s2 = helper.getRepository().login(null, null);
+        Session s = getHelper().getRepository().login();
+        Session s2 = getHelper().getRepository().login(null, null);
         try {
             assertNotNull(s.getUserID());
             assertEquals(s.getUserID(), s2.getUserID());

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java Wed Jul  8 13:57:13 2009
@@ -16,22 +16,23 @@
  */
 package org.apache.jackrabbit.core.security.authorization;
 
-import java.security.Principal;
-import java.util.Collections;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-import javax.jcr.security.AccessControlEntry;
-import javax.jcr.security.AccessControlException;
-import javax.jcr.security.Privilege;
-
 import org.apache.jackrabbit.api.JackrabbitSession;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.core.security.TestPrincipal;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;
 
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.security.AccessControlEntry;
+import javax.jcr.security.AccessControlException;
+import javax.jcr.security.Privilege;
+import java.security.Principal;
+import java.util.Collections;
+
 /**
  * <code>AbstractACLTemplateTest</code>...
  */

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEntryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEntryTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEntryTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEntryTest.java Wed Jul  8 13:57:13 2009
@@ -29,6 +29,7 @@
 
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
 
 /**
  * <code>AbstractEntryTest</code>...

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java Wed Jul  8 13:57:13 2009
@@ -16,30 +16,29 @@
  */
 package org.apache.jackrabbit.core.security.authorization;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.Privilege;
-
+import org.apache.jackrabbit.api.JackrabbitSession;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
-import org.apache.jackrabbit.api.JackrabbitSession;
-import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;
-import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.uuid.UUID;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import javax.jcr.Session;
-import javax.jcr.Node;
 import javax.jcr.Credentials;
-import javax.jcr.SimpleCredentials;
+import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-import java.util.Set;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.Privilege;
+import java.security.Principal;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.security.Principal;
+import java.util.Set;
 
 /** <code>AbstractEvaluationTest</code>... */
 public abstract class AbstractEvaluationTest extends AbstractAccessControlTest {
@@ -49,7 +48,7 @@
     protected User testUser;
     protected Credentials creds;
     
-    private SessionImpl testSession;
+    private Session testSession;
     private AccessControlManager testAccessControlManager;
     private Node trn;
     private Set toClear = new HashSet();
@@ -110,10 +109,9 @@
         }
     }
 
-    protected SessionImpl getTestSession() throws RepositoryException {
+    protected Session getTestSession() throws RepositoryException {
         if (testSession == null) {
-            // TODO: remove cast once 283 is released.
-            testSession = (SessionImpl) helper.getRepository().login(creds);
+            testSession = getHelper().getRepository().login(creds);
         }
         return testSession;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractNodeTypeManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractNodeTypeManagementTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractNodeTypeManagementTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractNodeTypeManagementTest.java Wed Jul  8 13:57:13 2009
@@ -99,16 +99,15 @@
         Node child = (Node) superuser.getItem(childNode.getPath());
         String ntName = child.getPrimaryNodeType().getName();
 
-        // TODO: remove casts once jsr 283 is released.        
         String changedNtName = "nt:folder";
-        ((javax.jcr.Node) child).setPrimaryType(changedNtName);
+        child.setPrimaryType(changedNtName);
         child.save();
 
         try {
             checkReadOnly(childNode.getPath());
 
             try {
-                ((javax.jcr.Node) childNode).setPrimaryType(ntName);
+                childNode.setPrimaryType(ntName);
                 childNode.save();
                 fail("TestSession does not have sufficient privileges to change the primary type.");
             } catch (AccessDeniedException e) {
@@ -116,28 +115,13 @@
                 getTestSession().refresh(false); // TODO: see JCR-1916
             }
 
-            /* for nt:folder set_property permission is required in addition
-               in order to be able to create jcr:created
-               TODO: check again with jsr 283 jcr:created was redesigned
-             */
             modifyPrivileges(childNode.getPath(), Privilege.JCR_NODE_TYPE_MANAGEMENT, true);
-            try {
-                ((javax.jcr.Node) childNode).setPrimaryType(ntName);
-                childNode.save();
-                fail("TestSession does not have sufficient privileges to change the primary type.");
-            } catch (AccessDeniedException e) {
-                // success
-                getTestSession().refresh(false); // TODO: see JCR-1916
-            }
-
-            // with complete write permission the call must succeed.
-            modifyPrivileges(childNode.getPath(), Privilege.JCR_MODIFY_PROPERTIES, true);
-            ((javax.jcr.Node) childNode).setPrimaryType(ntName);
+            childNode.setPrimaryType(ntName);
             childNode.save();
 
         } finally {
             if (!ntName.equals(child.getPrimaryNodeType().getName())) {
-                ((javax.jcr.Node) child).setPrimaryType(ntName);
+                child.setPrimaryType(ntName);
                 child.save();
             }
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractVersionManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractVersionManagementTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractVersionManagementTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractVersionManagementTest.java Wed Jul  8 13:57:13 2009
@@ -16,8 +16,7 @@
  */
 package org.apache.jackrabbit.core.security.authorization;
 
-import javax.jcr.security.Privilege;
-import javax.jcr.security.AccessControlEntry;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,6 +25,8 @@
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.RepositoryException;
+import javax.jcr.security.AccessControlEntry;
+import javax.jcr.security.Privilege;
 import javax.jcr.version.Version;
 
 /** <code>AbstractVersionAccessTest</code>... */

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractWriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractWriteTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractWriteTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractWriteTest.java Wed Jul  8 13:57:13 2009
@@ -16,12 +16,9 @@
  */
 package org.apache.jackrabbit.core.security.authorization;
 
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.Privilege;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
-import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.security.TestPrincipal;
 import org.apache.jackrabbit.test.JUnitTest;
 import org.apache.jackrabbit.test.NotExecutableException;
@@ -39,6 +36,9 @@
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.observation.Event;
 import javax.jcr.observation.ObservationManager;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.Privilege;
 import java.security.Principal;
 
 /**
@@ -128,7 +128,7 @@
          testuser must not have
          - REMOVE permission for child node
         */
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         String nonExChildPath = path + "/anyItem";
         assertTrue(testSession.hasPermission(nonExChildPath, "read,add_node,set_property"));
         assertFalse(testSession.hasPermission(nonExChildPath, "remove"));
@@ -181,7 +181,7 @@
         */
 
         // must still have read-access to path, ...
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         assertTrue(testSession.hasPermission(path, "read"));
         Node n = testSession.getNode(path);
         // ... siblings of childN
@@ -219,7 +219,7 @@
         // make sure the 'rep:policy' node has been created.
         assertTrue(superuser.itemExists(tmpl.getPath() + "/rep:policy"));
 
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         /*
          Testuser must still have READ-only access only and must not be
          allowed to view the acl-node that has been created.
@@ -251,7 +251,7 @@
           testuser must have READ-only permission on test-node and below
         */
         checkReadOnly(path);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         // give 'testUser' ADD_CHILD_NODES|MODIFY_PROPERTIES| REMOVE_CHILD_NODES privileges at 'path'
         Privilege[] privileges = privilegesFromNames(new String[] {
@@ -313,7 +313,7 @@
         // test if login as testuser -> item at path must not exist.
         Session s = null;
         try {
-            s = helper.getRepository().login(creds);
+            s = getHelper().getRepository().login(creds);
             assertFalse(s.itemExists(path));
         } finally {
             if (s != null) {
@@ -328,7 +328,7 @@
          testuser must have READ-only permission on test-node and below
         */
         checkReadOnly(path);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         // withdraw the READ privilege
         Privilege[] dnPrivs = privilegesFromName(Privilege.JCR_READ);
@@ -361,7 +361,7 @@
     }
 
     public void testInheritance() throws RepositoryException, NotExecutableException {
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         AccessControlManager testAcMgr = getTestACManager();
         /* precondition:
           testuser must have READ-only permission on test-node and below
@@ -439,7 +439,7 @@
         */
         checkReadOnly(path);
         checkReadOnly(childNPath);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         Privilege[] rmChildNodes = privilegesFromName(Privilege.JCR_REMOVE_CHILD_NODES);
 
@@ -461,7 +461,7 @@
         */
         checkReadOnly(path);
         checkReadOnly(childNPath);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         Privilege[] rmChildNodes = privilegesFromName(Privilege.JCR_REMOVE_NODE);
 
@@ -484,7 +484,7 @@
         */
         checkReadOnly(path);
         checkReadOnly(childNPath);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         Privilege[] privs = privilegesFromNames(new String[] {
                 Privilege.JCR_REMOVE_CHILD_NODES, Privilege.JCR_REMOVE_NODE
@@ -508,7 +508,7 @@
     }
 
     public void testRemovePermission4() throws NotExecutableException, RepositoryException {
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         AccessControlManager testAcMgr = getTestACManager();
         /*
           precondition:
@@ -555,7 +555,7 @@
     }
 
     public void testRemovePermission6() throws NotExecutableException, RepositoryException {
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         AccessControlManager testAcMgr = getTestACManager();
         /*
           precondition:
@@ -586,7 +586,7 @@
     }
 
     public void testRemovePermission7() throws NotExecutableException, RepositoryException {
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         AccessControlManager testAcMgr = getTestACManager();
         /*
           precondition:
@@ -652,7 +652,7 @@
         */
         checkReadOnly(path);
         checkReadOnly(childNPath);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         String destPath = path + "/" + nodeName1;
 
@@ -704,7 +704,7 @@
         */
         checkReadOnly(path);
         checkReadOnly(childNPath);
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
 
         String destPath = path + "/" + nodeName1;
 
@@ -802,7 +802,7 @@
         checkReadOnly(path);
 
         /* create some new nodes below 'path' */
-        Node n = ((SessionImpl) superuser).getNode(path);
+        Node n = superuser.getNode(path);
         for (int i = 0; i < 5; i++) {
             n = n.addNode(nodeName2, testNodeType);
         }
@@ -885,7 +885,7 @@
         checkReadOnly(path);
 
         /* create a child node below node at 'path' */
-        Node n = ((SessionImpl) superuser).getNode(path);
+        Node n = superuser.getNode(path);
         n = n.addNode(nodeName2, testNodeType);
         superuser.save();
 
@@ -897,7 +897,7 @@
            - testSession cannot add child-nodes at 'path'
            - testSession can add child-nodes below path
          */
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         assertFalse(testSession.hasPermission(path, javax.jcr.Session.ACTION_ADD_NODE));
         assertTrue(testSession.hasPermission(path+"/anychild", javax.jcr.Session.ACTION_ADD_NODE));
         String childPath = n.getPath();
@@ -915,7 +915,7 @@
         testUser = null;
 
         // try to retrieve the acl again
-        Session s = helper.getSuperuserSession();
+        Session s = getHelper().getSuperuserSession();
         try {
             AccessControlManager acMgr = getAccessControlManager(s);
             acMgr.getPolicies(acPath);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlListTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlListTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlListTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlListTest.java Wed Jul  8 13:57:13 2009
@@ -16,10 +16,13 @@
  */
 package org.apache.jackrabbit.core.security.authorization;
 
-import java.security.Principal;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import org.apache.jackrabbit.api.JackrabbitSession;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
+import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
+import org.apache.jackrabbit.api.security.principal.PrincipalManager;
+import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;
 
 import javax.jcr.Node;
 import javax.jcr.PropertyType;
@@ -28,12 +31,10 @@
 import javax.jcr.security.AccessControlPolicy;
 import javax.jcr.security.AccessControlPolicyIterator;
 import javax.jcr.security.Privilege;
-
-import org.apache.jackrabbit.api.JackrabbitSession;
-import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
-import org.apache.jackrabbit.api.security.principal.PrincipalManager;
-import org.apache.jackrabbit.test.NotExecutableException;
-import org.apache.jackrabbit.test.api.security.AbstractAccessControlTest;
+import java.security.Principal;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * <code>JackrabbitAccessControlListTest</code>...

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java Wed Jul  8 13:57:13 2009
@@ -17,18 +17,18 @@
 package org.apache.jackrabbit.core.security.authorization.acl;
 
 import org.apache.jackrabbit.api.JackrabbitSession;
-import javax.jcr.security.AccessControlEntry;
-import javax.jcr.security.AccessControlException;
-import javax.jcr.security.Privilege;
-import org.apache.jackrabbit.api.security.principal.PrincipalManager;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
+import org.apache.jackrabbit.api.security.principal.PrincipalManager;
+import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.security.authorization.AbstractACLTemplateTest;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
 import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
-import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.security.AccessControlEntry;
+import javax.jcr.security.AccessControlException;
+import javax.jcr.security.Privilege;
 import java.security.Principal;
 import java.security.acl.Group;
 import java.util.Collections;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EntryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EntryTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EntryTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EntryTest.java Wed Jul  8 13:57:13 2009
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
-import javax.jcr.security.Privilege;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
 import org.apache.jackrabbit.core.security.authorization.AbstractEntryTest;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlEntry;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.security.Privilege;
 import java.security.Principal;
 
 /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EvaluationUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EvaluationUtil.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EvaluationUtil.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/EvaluationUtil.java Wed Jul  8 13:57:13 2009
@@ -16,15 +16,15 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.AccessControlPolicyIterator;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.AccessDeniedException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.AccessControlPolicyIterator;
 import java.security.Principal;
 import java.util.Collections;
 import java.util.Map;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/LockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/LockTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/LockTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/LockTest.java Wed Jul  8 13:57:13 2009
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.core.security.authorization.AbstractLockManagementTest;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
-import javax.jcr.security.AccessControlManager;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.security.AccessControlManager;
 import java.security.Principal;
 import java.util.Map;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/NodeTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/NodeTypeTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/NodeTypeTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/NodeTypeTest.java Wed Jul  8 13:57:13 2009
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.core.security.authorization.AbstractNodeTypeManagementTest;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
-import javax.jcr.security.AccessControlManager;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.security.AccessControlManager;
 import java.security.Principal;
 import java.util.Map;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/TestAll.java Wed Jul  8 13:57:13 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
+import org.apache.jackrabbit.test.ConcurrentTestSuite;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -33,7 +35,7 @@
      *         package.
      */
     public static Test suite() {
-        TestSuite suite = new TestSuite("security.authorization.acl tests");
+        TestSuite suite = new ConcurrentTestSuite("security.authorization.acl tests");
 
         suite.addTestSuite(ACLTemplateTest.class);
         suite.addTestSuite(EntryTest.class);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/VersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/VersionTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/VersionTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/VersionTest.java Wed Jul  8 13:57:13 2009
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.core.security.authorization.AbstractVersionManagementTest;
-import javax.jcr.security.AccessControlManager;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.security.AccessControlManager;
 import java.security.Principal;
 import java.util.Map;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/WriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/WriteTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/WriteTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/WriteTest.java Wed Jul  8 13:57:13 2009
@@ -16,24 +16,24 @@
  */
 package org.apache.jackrabbit.core.security.authorization.acl;
 
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.AccessControlPolicyIterator;
-import javax.jcr.security.Privilege;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
+import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.security.authorization.AbstractWriteTest;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
-import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
 import org.apache.jackrabbit.core.security.authorization.AccessControlConstants;
-import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
 import org.apache.jackrabbit.test.NotExecutableException;
 
 import javax.jcr.AccessDeniedException;
+import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.Node;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.AccessControlPolicyIterator;
+import javax.jcr.security.Privilege;
+import java.security.Principal;
 import java.util.Collections;
 import java.util.Map;
-import java.security.Principal;
 
 /**
  * <code>EvaluationTest</code>...
@@ -45,24 +45,7 @@
     }
 
     protected JackrabbitAccessControlList getPolicy(AccessControlManager acM, String path, Principal principal) throws RepositoryException, AccessDeniedException, NotExecutableException {
-        // first try if there is a new applicable policy
-        AccessControlPolicyIterator it = acM.getApplicablePolicies(path);
-        while (it.hasNext()) {
-            AccessControlPolicy acp = it.nextAccessControlPolicy();
-            if (acp instanceof ACLTemplate) {
-                return (ACLTemplate) acp;
-            }
-        }
-        // try if there is an acl that has been set before:
-        AccessControlPolicy[] pcls = acM.getPolicies(path);
-        for (int i = 0; i < pcls.length; i++) {
-            AccessControlPolicy policy = pcls[i];
-            if (policy instanceof ACLTemplate) {
-                return (ACLTemplate) policy;
-            }
-        }
-        // no applicable or existing ACLTemplate to edit -> not executable.
-        throw new NotExecutableException("ACLTemplate expected.");
+        return EvaluationUtil.getPolicy(acM, path, principal);
     }
 
     protected Map getRestrictions(Session s, String path) {
@@ -95,7 +78,7 @@
         // make sure the 'rep:policy' node has been created.
         assertTrue(superuser.itemExists(tmpl.getPath() + "/rep:policy"));
 
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         AccessControlManager testAcMgr = getTestACManager();
         // test: MODIFY_AC granted at 'path'
         assertTrue(testAcMgr.hasPrivileges(path, privilegesFromName(Privilege.JCR_MODIFY_ACCESS_CONTROL)));

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/combined/WriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/combined/WriteTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/combined/WriteTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/combined/WriteTest.java Wed Jul  8 13:57:13 2009
@@ -16,24 +16,25 @@
  */
 package org.apache.jackrabbit.core.security.authorization.combined;
 
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.Privilege;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlManager;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.security.JackrabbitAccessControlManager;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
 import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.jcr.AccessDeniedException;
-import javax.jcr.RepositoryException;
 import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.Privilege;
 import java.security.Principal;
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * <code>EvaluationTest</code>...
@@ -111,7 +112,7 @@
 
     public void testCombinedPolicies() throws RepositoryException, NotExecutableException {
         Group testGroup = getTestGroup();
-        SessionImpl testSession = getTestSession();
+        Session testSession = getTestSession();
         AccessControlManager testAcMgr = getTestACManager();
 
         /*



Mime
View raw message