jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r506915 - in /jackrabbit/trunk/contrib/spi/client/src/test: config/ java/org/apache/jackrabbit/jcr2spi/ java/org/apache/jackrabbit/jcr2spi/lock/ java/org/apache/jackrabbit/jcr2spi/nodetype/ java/org/apache/jackrabbit/test/
Date Tue, 13 Feb 2007 09:02:13 GMT
Author: angela
Date: Tue Feb 13 01:02:11 2007
New Revision: 506915

URL: http://svn.apache.org/viewvc?view=rev&rev=506915
Log:
work in progress

- tests



Added:
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java   (with props)
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java   (with props)
Modified:
    jackrabbit/trunk/contrib/spi/client/src/test/config/repositoryStubImpl.properties
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AccessByRelativePathTest.java
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java

Modified: jackrabbit/trunk/contrib/spi/client/src/test/config/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/config/repositoryStubImpl.properties?view=diff&rev=506915&r1=506914&r2=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/config/repositoryStubImpl.properties (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/config/repositoryStubImpl.properties Tue Feb 13 01:02:11 2007
@@ -6,15 +6,15 @@
 javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.jcr2spi.JCR2SPIRepositoryStub
 
 # repository specific configuration
-org.apache.jackrabbit.jcr2spi.repository.url=http://localhost:8080/jackrabbit-webapp/server/
+org.apache.jackrabbit.jcr2spi.repository.url=http://localhost:5502/jackrabbit/server/
 org.apache.jackrabbit.jcr2spi.workspace.name=default
 
 
 # credential configuration
-javax.jcr.tck.superuser.name=superuser
-javax.jcr.tck.superuser.pwd=
+javax.jcr.tck.superuser.name=admin
+javax.jcr.tck.superuser.pwd=admin
 javax.jcr.tck.readwrite.name=user
-javax.jcr.tck.readwrite.pwd=
+javax.jcr.tck.readwrite.pwd=user
 javax.jcr.tck.readonly.name=anonymous
 javax.jcr.tck.readonly.pwd=
 
@@ -27,7 +27,7 @@
 javax.jcr.tck.nodename4=node4
 javax.jcr.tck.propertyname1=prop1
 javax.jcr.tck.propertyname2=prop2
-javax.jcr.tck.workspacename=test
+javax.jcr.tck.workspacename=second
 
 # namespace configuration
 javax.jcr.tck.namespaces=test
@@ -233,10 +233,10 @@
 javax.jcr.tck.RepositoryLoginTest.testroot=/testdata
 
 # Test class: RootNodeTest
-javax.jcr.tck.RootNodeTest.testroot=/testdata
+javax.jcr.tck.RootNodeTest.testroot=/testroot
 
 # Test class: ReferenceableRootNodesTest
-javax.jcr.tck.ReferenceableRootNodesTest.testroot=/testdata
+javax.jcr.tck.ReferenceableRootNodesTest.testroot=/testroot
 
 # Test class: ExportDocViewTest
 javax.jcr.tck.ExportDocViewTest.testroot=/testdata

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AccessByRelativePathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AccessByRelativePathTest.java?view=diff&rev=506915&r1=506914&r2=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AccessByRelativePathTest.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AccessByRelativePathTest.java Tue Feb 13 01:02:11 2007
@@ -71,7 +71,7 @@
          try {
              root.getNode(DOTDOT);
              fail("Root does not have a parent node. <root>.getNode(\"..\") must fail.");
-         } catch (PathNotFoundException e) {
+         } catch (RepositoryException e) {
              // ok.
          }
     }

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Property;
+import javax.jcr.Value;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.lock.LockException;
+
+/**
+ * <code>AddNewPropertyTest</code>...
+ */
+public class AddNewPropertyTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(AddNewPropertyTest.class);
+
+    private String propname;
+
+    protected void tearDown() throws Exception {
+        testRootNode.refresh(false);
+        super.tearDown();
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        String propName = propertyName1;
+        while (testRootNode.hasProperty(propName)) {
+            propName = propName + "_";
+        }
+        this.propname = propName;
+    }
+
+    public void testPropertyAccessibleAfterSave() throws NotExecutableException, RepositoryException {
+        Property p;
+        try {
+            p = testRootNode.setProperty(propname, "anyValue");
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        // check if p is valid and can be accessed from the parent node.
+        String name = p.getName();
+        assertEquals("Added property must have the original name", name, propname);
+        assertTrue("Accessing the created property again must return the 'same' item.", p.isSame(testRootNode.getProperty(propname)));
+    }
+
+    /**
+     * Implementation specific test: Node.setProperty for non-existing property
+     * with a <code>null</code> value must throw  <code>ItemNotFoundException</code>
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     * @throws LockException
+     * @throws ConstraintViolationException
+     * @throws VersionException
+     */
+    public void testAddPropertyWithNullValue() throws NotExecutableException, RepositoryException, LockException, ConstraintViolationException, VersionException {
+        try {
+            testRootNode.setProperty(propname, (Value) null);
+        } catch (ItemNotFoundException e) {
+            // OK
+        }
+    }
+
+    /**
+     * Implementation specific test: Node.setProperty for non-existing property
+     * with a <code>null</code> value array must throw  <code>ItemNotFoundException</code>
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     * @throws LockException
+     * @throws ConstraintViolationException
+     * @throws VersionException
+     */
+    public void testAddPropertyWithNullValues() throws NotExecutableException, RepositoryException, LockException, ConstraintViolationException, VersionException {
+        try {
+            testRootNode.setProperty(propname, (Value[]) null);
+        } catch (ItemNotFoundException e) {
+            // OK
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/AddNewPropertyTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java?view=diff&rev=506915&r1=506914&r2=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java Tue Feb 13 01:02:11 2007
@@ -86,11 +86,11 @@
                     }
 
                     public CacheBehaviour getCacheBehaviour() {
-                        return CacheBehaviour.OBSERVATION;
+                        return CacheBehaviour.INVALIDATE;
                     }
 
                     public int getPollingInterval() {
-                        return 3 * 1000;
+                        return 3 * 100000000;
                     }
                 };
 

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Node;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.Session;
+import javax.jcr.Property;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.lock.LockException;
+import java.util.List;
+import java.util.Arrays;
+
+/**
+ * <code>UpdateTest</code>...
+ */
+public class UpdateTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(UpdateTest.class);
+
+    private String currentWorkspace;
+    private String[] accessibleWorkspaces;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        currentWorkspace = testRootNode.getSession().getWorkspace().getName();
+        accessibleWorkspaces = testRootNode.getSession().getWorkspace().getAccessibleWorkspaceNames();
+    }
+
+    public void testInvalidSrcWorkspace() throws RepositoryException, InvalidItemStateException, AccessDeniedException {
+        String nonExistingWorkspace = "nonExistingWorkspace";
+        List l = Arrays.asList(accessibleWorkspaces);
+        while (l.contains(nonExistingWorkspace)) {
+            nonExistingWorkspace = nonExistingWorkspace + "_";
+        }
+
+        try {
+            testRootNode.update(nonExistingWorkspace);
+        } catch (NoSuchWorkspaceException e) {
+            //  ok
+        }
+    }
+
+    public void testNoCorrespondingNode() throws RepositoryException, InvalidItemStateException, AccessDeniedException, NotExecutableException {
+        Node n = testRootNode.addNode(nodeName2, testNodeType);
+        testRootNode.save();
+
+        String srcWorkspace = null;
+        for (int i = 0; i < accessibleWorkspaces.length; i++) {
+            if (!accessibleWorkspaces.equals(currentWorkspace)) {
+                try {
+                    n.getCorrespondingNodePath(accessibleWorkspaces[i]);
+                } catch (ItemNotFoundException e) {
+                    srcWorkspace = accessibleWorkspaces[i];
+                }
+            }
+        }
+        if (srcWorkspace == null) {
+            throw new NotExecutableException("Cannot run update. No workspace found, that misses the corresponding node.");
+        }
+
+        try {
+            // update without corresponding node must be a nop
+            testRootNode.update(srcWorkspace);
+        } catch (RepositoryException e) {
+            fail("Update with workspace that doesn't contain the corresponding node must work.");
+        }
+    }
+
+    public void testSameWorkspace() throws RepositoryException, InvalidItemStateException, AccessDeniedException, NotExecutableException {
+        try {
+            // update without corresponding node must be a nop
+            testRootNode.update(currentWorkspace);
+        } catch (RepositoryException e) {
+            fail("Update with srcWorkspace == this workspace must return silently.");
+        }
+    }
+
+    public void testPendingChangesSameWorkspace() throws RepositoryException, InvalidItemStateException, AccessDeniedException, NotExecutableException {
+        testRootNode.addNode(nodeName2, testNodeType);
+
+        try {
+            testRootNode.update(currentWorkspace);
+            fail("Update while changes are pending must fail with InvalidItemStateException");
+        } catch (InvalidItemStateException  e) {
+            // ok
+        }
+    }
+
+    public void testPendingChanges() throws RepositoryException, LockException, ConstraintViolationException, NoSuchNodeTypeException, ItemExistsException, VersionException, NotExecutableException {
+        testRootNode.addNode(nodeName2, testNodeType);
+
+        String srcWorkspace = getAnotherWorkspace();
+        try {
+            testRootNode.update(srcWorkspace);
+            fail("Update while changes are pending must fail with InvalidItemStateException");
+        } catch (InvalidItemStateException  e) {
+            // ok
+        }
+    }
+
+    public void testPendingChangesOnOtherNode() throws RepositoryException, LockException, ConstraintViolationException, NoSuchNodeTypeException, ItemExistsException, VersionException, NotExecutableException {
+        try {
+        Node root = testRootNode.getSession().getRootNode();
+            if (root.isSame(testRootNode)) {
+                throw new NotExecutableException();
+            }
+            if (root.canAddMixin("mixLockable")) {
+                root.addMixin("mixLockable");
+            } else {
+                root.setProperty(propertyName1, "anyValue");
+            }
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        String srcWorkspace = getAnotherWorkspace();
+        try {
+            testRootNode.update(srcWorkspace);
+            fail("Update while changes are pending must fail with InvalidItemStateException");
+        } catch (InvalidItemStateException  e) {
+            // ok
+        }
+    }
+
+    public void testUpdateRemovesExtraProperty() throws RepositoryException, NotExecutableException {
+        // create test node in default workspace
+        testRootNode.setProperty(propertyName1, "test");
+        testRootNode.save();
+
+        String srcWorkspace = getAnotherWorkspace();
+        // get the root node in the second workspace
+        Session session2 = helper.getSuperuserSession(srcWorkspace);
+        // make sure the source-session has the corresponding node.
+        Node testRootW2 = (Node) session2.getItem(testRootNode.getCorrespondingNodePath(srcWorkspace));
+
+        // call the update method on test node in default workspace
+        testRootNode.update(srcWorkspace);
+
+        // ok first check if node has no longer propertis
+        assertFalse("Node updated with Node.update() should have property removed", testRootNode.hasProperty(propertyName1));
+    }
+
+    public void testUpdateAddsMissingSubtree() throws RepositoryException, NotExecutableException {
+        String srcWorkspace = getAnotherWorkspace();
+        // get the root node in the second workspace
+        Session session2 = helper.getSuperuserSession(srcWorkspace);
+        // make sure the source-session has the corresponding node.
+        Node testRootW2 = (Node) session2.getItem(testRootNode.getCorrespondingNodePath(srcWorkspace));
+
+        // create test node in second workspace
+        Node aNode2 = testRootW2.addNode(nodeName1, testNodeType);
+        aNode2.addNode(nodeName2, testNodeType);
+        aNode2.setProperty(propertyName2, "test");
+        Property p2 = testRootW2.setProperty(propertyName1, "test");
+        testRootW2.save();
+
+        // call the update method on test node in default workspace
+        testRootNode.update(srcWorkspace);
+
+        // ok check if the child has been added
+        boolean allPresent = testRootNode.hasNode(nodeName1) &&
+                             testRootNode.hasNode(nodeName1+"/"+nodeName2) &&
+                             testRootNode.hasProperty(nodeName1+"/"+propertyName2) &&
+                             testRootNode.hasProperty(propertyName1);
+        assertTrue("Node updated with Node.update() should have received childrens", allPresent);
+    }
+
+    private String getAnotherWorkspace() throws NotExecutableException {
+        String srcWorkspace = null;
+        for (int i = 0; i < accessibleWorkspaces.length; i++) {
+            if (!accessibleWorkspaces.equals(currentWorkspace)) {
+                srcWorkspace = accessibleWorkspaces[i];
+            }
+        }
+        if (srcWorkspace == null) {
+            throw new NotExecutableException("Cannot run update. No workspace found, that misses the corresponding node.");
+        }
+        return srcWorkspace;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/UpdateTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi.lock;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.Session;
+import javax.jcr.RepositoryException;
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockException;
+
+/**
+ * <code>AbstractLockTest</code>...
+ */
+public abstract class AbstractLockTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(AbstractLockTest.class);
+
+    Node lockedNode;
+    Node childNode;
+    Lock lock;
+
+    abstract boolean isSessionScoped();
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        lockedNode = testRootNode.addNode(nodeName1, testNodeType);
+        lockedNode.addMixin(mixLockable);
+        childNode = lockedNode.addNode(nodeName2, testNodeType);
+        testRootNode.save();
+
+        lock = lockedNode.lock(false, isSessionScoped());
+    }
+
+    protected void tearDown() throws Exception {
+        try {
+            // make sure all locks are removed
+            lockedNode.unlock();
+        } catch (RepositoryException e) {
+            // ignore
+        }
+        super.tearDown();
+    }
+
+    public void testParentChildLock() throws Exception {
+        childNode.addMixin(mixLockable);
+        testRootNode.save();
+
+        // lock child node
+        try {
+            childNode.lock(false, isSessionScoped());
+            // unlock parent node
+            lockedNode.unlock();
+            // child node must still hold lock
+            assertTrue("child node must still hold lock", childNode.isLocked() && childNode.holdsLock());
+        } finally {
+            childNode.unlock();
+        }
+    }
+
+    public void testParentChildLock2() throws Exception {
+        childNode.addMixin(mixLockable);
+        testRootNode.save();
+        try {
+            Lock l = childNode.lock(false, isSessionScoped());
+            assertTrue("child node must still hold lock", l.getNode().isSame(childNode));
+        } finally {
+            childNode.unlock();
+        }
+    }
+
+    /**
+     * Test Lock.isDeep()
+     */
+    public void testNotIsDeep() throws RepositoryException {
+        assertFalse("Lock.isDeep() must be false if the lock has not been set as not deep", lock.isDeep());
+    }
+
+    /**
+     * Test Lock.isSessionScoped()
+     */
+    public void testIsSessionScoped() throws RepositoryException {
+        if (isSessionScoped()) {
+            assertTrue("Lock.isSessionScoped() must be true.", lock.isSessionScoped());
+        } else {
+            assertFalse("Lock.isSessionScoped() must be false. ", lock.isSessionScoped());
+        }
+    }
+
+    public void testLockIsLive() throws RepositoryException {
+        // assert: lock must be alive
+        assertTrue("lock must be alive", lock.isLive());
+    }
+
+    public void testRefresh() throws RepositoryException {
+        // assert: refresh must succeed
+        lock.refresh();
+    }
+
+    public void testUnlock() throws RepositoryException {
+        // unlock node
+        lockedNode.unlock();
+        // assert: lock must not be alive
+        assertFalse("lock must not be alive", lock.isLive());
+    }
+
+    public void testRefreshNotLive() throws Exception {
+        // unlock node
+        lockedNode.unlock();
+        // refresh
+        try {
+            lock.refresh();
+            fail("Refresh on a lock that is not alive must fail");
+        } catch (LockException e) {
+            // success
+        }
+    }
+
+    /**
+     * Tests if a locked, checked-in node can be unlocked
+     */
+    public void testCheckedInUnlock() throws Exception {
+        if (!isSupported(Repository.OPTION_VERSIONING_SUPPORTED)) {
+            throw new NotExecutableException("Repository does not support versioning.");
+        }
+
+        lockedNode.addMixin(mixVersionable);
+        lockedNode.save();
+
+        // lock and check-in
+        lockedNode.checkin();
+
+        // do the unlock
+        lockedNode.unlock();
+        assertFalse("Could not unlock a locked, checked-in node", lockedNode.holdsLock());
+    }
+
+    public void testReorder() throws Exception {
+        testRootNode.addNode(nodeName2);
+        testRootNode.addNode(nodeName3);
+        testRootNode.save();
+
+        // move last node in front of first
+        testRootNode.orderBefore(lockedNode.getName(), nodeName3);
+        testRootNode.save();
+
+        assertTrue("Node must remain locked upon reordering", testRootNode.getNode(lockedNode.getName()).isLocked());
+    }
+
+    public void testReorderSNS() throws Exception {
+        // create 2 additional nodes with same name
+        testRootNode.addNode(nodeName1);
+        testRootNode.addNode(nodeName1);
+        testRootNode.save();
+
+        // assert: first node locked
+        assertTrue("First child node locked", testRootNode.getNode(nodeName1 + "[1]").isLocked());
+
+        // move first node to last
+        testRootNode.orderBefore(nodeName1 + "[1]", null);
+        testRootNode.save();
+
+        // assert: third node locked
+        assertTrue("Third child node locked", testRootNode.getNode(nodeName1 + "[3]").isLocked());
+    }
+
+    /**
+     * Tests if move preserves lock state (JIRA issue JCR-207). A node that has
+     * been locked must still appear locked when it has been moved or renamed,
+     * regardless whether the changes have already been made persistent.
+     */
+    public void testMoveLocked() throws Exception {
+
+        Session session = testRootNode.getSession();
+
+        childNode.addMixin(mixLockable);
+        childNode.save();
+
+        try {
+            // lock child node
+            childNode.lock(false, isSessionScoped());
+
+            // assert: child node locked
+            assertTrue("Child node locked", childNode.isLocked());
+
+            // move child node up
+            String newPath = testRootNode.getPath() + "/" + childNode.getName();
+            session.move(childNode.getPath(), newPath);
+
+            // assert: child node locked, before save
+            assertTrue("Child node locked before save", childNode.isLocked());
+            session.save();
+
+            // assert: child node locked, after save
+            assertTrue("Child node locked after save", childNode.isLocked());
+
+        } finally {
+            childNode.unlock();
+        }
+    }
+
+    /**
+     * Tests if unlocking the first of two locked same-name sibling nodes does
+     * not unlock the second (JIRA issue JCR-284).
+     */
+    public void testUnlockSameNameSibling() throws RepositoryException {
+        Session session = testRootNode.getSession();
+
+        // create two same-name sibling nodes
+        Node lockedNode2 = testRootNode.addNode(nodeName1);
+        lockedNode2.addMixin("mix:lockable");
+        session.save();
+
+        // lock both nodes
+        lockedNode2.lock(false, isSessionScoped());
+
+        try {
+            // assert: both nodes are locked
+            assertTrue("First node locked: ", lockedNode.isLocked());
+            assertTrue("Second node locked: ", lockedNode2.isLocked());
+        } catch (RepositoryException e) {
+            // mk sure all locks are release again
+            lockedNode.unlock();
+            lockedNode2.unlock();
+            throw new RepositoryException(e);
+        }
+
+        try {
+            // unlock first sibling
+            lockedNode.unlock();
+
+            // assert: first node unlocked, second node still locked
+            assertFalse("First node unlocked: ", lockedNode.isLocked());
+            assertTrue("Second node locked: ", lockedNode2.isLocked());
+
+        } finally {
+            // mk sure all locks are release again
+            lockedNode2.unlock();
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi.lock;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockException;
+
+/**
+ * <code>DeepLockTest</code>...
+ */
+public class DeepLockTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(DeepLockTest.class);
+
+    private boolean isSessionScoped = true;
+    private boolean isDeep = true;
+
+    private Node lockedNode;
+    private Node childNode;
+    private Lock lock;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        lockedNode = testRootNode.addNode(nodeName1, testNodeType);
+        lockedNode.addMixin(mixLockable);
+        childNode = lockedNode.addNode(nodeName2, testNodeType);
+        testRootNode.save();
+
+        lock = lockedNode.lock(isDeep, isSessionScoped);
+    }
+
+    public void testLockHoldingNode() throws RepositoryException {
+        assertTrue("Lock.getNode() must be lockholding node.", lock.getNode().isSame(lockedNode));
+    }
+
+    public void testLockIsDeep() throws RepositoryException {
+        assertTrue("Lock.isDeep() if lock has been created deeply.", lock.isDeep());
+    }
+
+    public void testIsLockedChild() throws RepositoryException {
+        assertTrue("Child node below deep lock must be locked", childNode.isLocked());
+    }
+
+    public void testNotHoldsLockChild() throws RepositoryException {
+        assertFalse("Child node below deep lock must not be lock holder", childNode.holdsLock());
+    }
+
+    public void testGetLockOnChild() throws RepositoryException {
+        // get lock must succeed even if child is not lockable.
+        Lock lock = childNode.getLock();
+    }
+
+    public void testGetNodeOnLockObtainedFromChild() throws RepositoryException {
+        Lock lock = childNode.getLock();
+        assertTrue("Lock.getNode() must return the lock holding node even if lock is obtained from child node.", lock.getNode().isSame(lockedNode));
+    }
+
+    public void testParentChildDeepLock() throws RepositoryException {
+        childNode.addMixin(mixLockable);
+        testRootNode.save();
+
+        // try to lock child node
+        try {
+            childNode.lock(false, isSessionScoped);
+            fail("child node is already locked by deep lock on parent.");
+        } catch (LockException e) {
+            // ok
+        }
+    }
+
+    public void testDeepLockAboveLockedChild() throws RepositoryException, NotExecutableException {
+        try {
+            Node parent = lockedNode.getParent();
+            if (!parent.isNodeType(mixLockable)) {
+                try {
+                    parent.addMixin(mixLockable);
+                    parent.save();
+                } catch (RepositoryException e) {
+                    throw new NotExecutableException();
+                }
+            }
+
+            parent.lock(true, isSessionScoped);
+            fail("Creating a deep lock on a parent of a locked node must fail.");
+        } catch (LockException e) {
+            // expected
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/DeepLockTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi.lock;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jcr.Node;
+import javax.jcr.Session;
+import javax.jcr.lock.LockException;
+import javax.jcr.lock.Lock;
+
+/**
+ * <code>OpenScopedLockTest</code>...
+ */
+public class OpenScopedLockTest extends AbstractLockTest {
+
+    private static Logger log = LoggerFactory.getLogger(OpenScopedLockTest.class);
+
+    boolean isSessionScoped() {
+        return false;
+    }
+
+    public void testLogoutHasNoEffect() throws Exception {
+        // create a second session session. since loggin-out the 'superuser'
+        // will cause all inhertied tear-down to fail
+        Session otherSession = helper.getSuperuserSession();
+        Node testRoot2 = (Node) otherSession.getItem(testRootNode.getPath());
+
+        Node lockedNode2 = testRoot2.addNode(nodeName2, testNodeType);
+        lockedNode2.addMixin(mixLockable);
+        testRoot2.save();
+
+        Lock lock2 = lockedNode2.lock(false, isSessionScoped());
+        Node n2 = (Node) superuser.getItem(lockedNode2.getPath());
+        try {
+            String lockToken = lock2.getLockToken();
+            otherSession.removeLockToken(lockToken);
+            superuser.addLockToken(lockToken);
+            otherSession.logout();
+
+            assertTrue("After logout a open-scoped node must still be locked.", lock2.isLive());
+            assertTrue("After logout a open-scoped node must still be locked.", n2.isLocked());
+        } finally {
+            n2.unlock();
+        }
+    }
+
+    public void testTokenTransfer() throws Exception {
+        String lockToken = lock.getLockToken();
+        try {
+            superuser.removeLockToken(lockToken);
+            assertNull("After token transfer lock-token must not be visible", lock.getLockToken());
+        } finally {
+            // move lock token back in order to have lock removed properly
+            superuser.addLockToken(lockToken);
+        }
+    }
+
+    public void testRefreshAfterTokenTransfer() throws Exception {
+        String lockToken = lock.getLockToken();
+        try {
+            superuser.removeLockToken(lockToken);
+            lock.refresh();
+            fail("After transfering lock token the original lock object cannot be refresh by session, that does hold lock any more.");
+        } catch (LockException e) {
+            // oK
+        } finally {
+            // move lock token back in order to have lock removed properly
+            superuser.addLockToken(lockToken);
+        }
+    }
+
+public void testRefreshAfterTokenTransfer2() throws Exception {
+        String lockToken = lock.getLockToken();
+
+        Session otherSession = helper.getSuperuserSession();
+        Node n2 = (Node) otherSession.getItem(lockedNode.getPath());
+        try {
+            superuser.removeLockToken(lockToken);
+            otherSession.addLockToken(lockToken);
+
+            n2.getLock().refresh();
+        } finally {
+            // move lock token back in order to have lock removed properly
+            otherSession.removeLockToken(lockToken);
+            superuser.addLockToken(lockToken);
+        }
+    }
+
+    public void testLockHolderAfterTokenTransfer() throws Exception {
+        String lockToken = lock.getLockToken();
+        Session otherSession = helper.getSuperuserSession();
+        Node n2 = (Node) otherSession.getItem(lockedNode.getPath());
+        try {
+            superuser.removeLockToken(lockToken);
+            otherSession.addLockToken(lockToken);
+
+            assertTrue("After lockToken transfer, the new lockHolder must get a non-null token", n2.getLock().getLockToken() != null);
+            assertTrue("After lockToken transfer, the new lockHolder must get the same token.", n2.getLock().getLockToken().equals(lockToken));
+        } finally {
+            // move lock token back in order to have lock removed properly
+            otherSession.removeLockToken(lockToken);
+            superuser.addLockToken(lockToken);
+        }
+    }
+
+    public void testUnlockAfterTokenTransfer() throws Exception {
+        String lockToken = lock.getLockToken();
+        try {
+            superuser.removeLockToken(lockToken);
+            lockedNode.unlock();
+            fail("After transfering lock token the original lock object cannot be unlocked by session, that does hold lock any more.");
+        } catch (LockException e) {
+            // oK
+        } finally {
+            // move lock token back in order to have lock removed properly
+            superuser.addLockToken(lockToken);
+        }
+    }
+
+    public void testUnlockAfterTokenTransfer2() throws Exception {
+        String lockToken = lock.getLockToken();
+        Session otherSession = helper.getSuperuserSession();
+        try {
+            superuser.removeLockToken(lockToken);
+            otherSession.addLockToken(lockToken);
+
+            // otherSession is now lockHolder -> unlock must succeed.
+            Node n2 = (Node) otherSession.getItem(lockedNode.getPath());
+            n2.unlock();
+        } finally {
+            // only in case of failure:
+            // move lock token back in order to have lock removed properly
+            // if test succeeds, moving back tokens is not necessary.
+            otherSession.removeLockToken(lockToken);
+            superuser.addLockToken(lockToken);
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/OpenScopedLockTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi.lock;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jcr.Node;
+import javax.jcr.Session;
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.LockException;
+import javax.jcr.lock.Lock;
+
+/**
+ * <code>SessionScopedLockTest</code>...
+ */
+public class SessionScopedLockTest extends AbstractLockTest {
+
+    private static Logger log = LoggerFactory.getLogger(SessionScopedLockTest.class);
+
+    boolean isSessionScoped() {
+        return true;
+    }
+
+    /**
+     * Test locks are released when session logs out
+     */
+    public void testLockNotLiveAfterLogout() throws RepositoryException {
+        Session otherSession = helper.getSuperuserSession();
+        Node testRoot2 = (Node) otherSession.getItem(testRootNode.getPath());
+
+        Node lockedNode2 = testRoot2.addNode(nodeName2, testNodeType);
+        lockedNode2.addMixin(mixLockable);
+        testRoot2.save();
+
+        Lock lock2 = lockedNode2.lock(false, isSessionScoped());
+        otherSession.logout();
+
+        assertFalse(lock2.isLive());
+    }
+
+    /**
+     * Test locks are released when session logs out
+     */
+    public void testNotLockedAfterLogout() throws RepositoryException {
+        Session otherSession = helper.getSuperuserSession();
+        Node testRoot2 = (Node) otherSession.getItem(testRootNode.getPath());
+
+        Node lockedNode2 = testRoot2.addNode(nodeName2, testNodeType);
+        lockedNode2.addMixin(mixLockable);
+        testRoot2.save();
+
+        Node n2 = (Node) superuser.getItem(lockedNode2.getPath());
+
+        // remove lock implicit by logout lock-holding session
+        otherSession.logout();
+
+        assertFalse(n2.isLocked());
+        assertFalse(n2.holdsLock());
+        try {
+            n2.getLock();
+            fail("Upon logout of the session a session-scoped lock must be gone.");
+        } catch (LockException e) {
+            // ok
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/SessionScopedLockTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi.nodetype;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeManager;
+import java.util.List;
+import java.util.Arrays;
+
+/**
+ * <code>AddMixinTest</code>...
+ */
+public class AddMixinTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(AddMixinTest.class);
+
+    private NodeTypeManager ntMgr;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        ntMgr = testRootNode.getSession().getWorkspace().getNodeTypeManager();
+    }
+
+
+    protected void tearDown() throws Exception {
+        testRootNode.refresh(false);
+        super.tearDown();
+    }
+
+    /**
+     * Implementation specific test for 'addMixin' only taking effect upon
+     * save.
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testAddMixinToNewNode() throws NotExecutableException, RepositoryException {
+        Node newNode;
+        try {
+            newNode = testRootNode.addNode(nodeName1, testNodeType);
+            newNode.addMixin(mixReferenceable);
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        assertFalse("Mixin must not be active before Node has been saved.", newNode.isNodeType(mixReferenceable));
+        NodeType[] mixins = newNode.getMixinNodeTypes();
+        for (int i = 0; i < mixins.length; i++) {
+            if (mixins[i].getName().equals(testNodeType)) {
+                fail("Mixin must not be active before Node has been saved.");
+            }
+        }
+    }
+
+    /**
+     * Implementation specific test adding a new Node with a nodeType, that has
+     * a mixin-supertype. The mixin must only take effect upon save.
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testImplicitMixinOnNewNode() throws NotExecutableException, RepositoryException {
+        Node newNode;
+        try {
+            String ntResource = superuser.getNamespacePrefix(NS_NT_URI) + ":resource";
+            newNode = testRootNode.addNode(nodeName1, ntResource);
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        assertFalse("Implict Mixin inherited by primary Nodetype must not be active before Node has been saved.", newNode.isNodeType(mixReferenceable));
+        NodeType[] mixins = newNode.getMixinNodeTypes();
+        for (int i = 0; i < mixins.length; i++) {
+            if (mixins[i].getName().equals(testNodeType)) {
+                fail("Implict Mixin inherited by primary Nodetype must not be active before Node has been saved.");
+            }
+        }
+    }
+
+    /**
+     * Implementation specific test adding a new Node with a nodeType, that has
+     * a mixin-supertype. The mixin must only take effect upon save.
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testAddMultipleAtOnce() throws NotExecutableException, RepositoryException {
+        Node node;
+        try {
+            node = testRootNode.addNode(nodeName1, testNodeType);
+            node.addMixin(mixReferenceable);
+            node.addMixin(mixLockable);
+            testRootNode.save();
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        assertTrue("Adding 2 mixins at once -> both must be present.", node.isNodeType(mixReferenceable) && node.isNodeType(mixLockable));
+        List mixins = Arrays.asList(node.getMixinNodeTypes());
+        assertTrue("Adding 2 mixins at once -> both must be present.", mixins.contains(ntMgr.getNodeType(mixReferenceable)) && mixins.contains(ntMgr.getNodeType(mixLockable)));
+    }
+
+    /**
+     * Implementation specific test adding a new Node with a nodeType, that has
+     * a mixin-supertype. The mixin must only take effect upon save.
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testAddMultipleSeparately() throws NotExecutableException, RepositoryException {
+        Node node;
+        try {
+            node = testRootNode.addNode(nodeName1, testNodeType);
+            node.addMixin(mixReferenceable);
+            testRootNode.save();
+            node.addMixin(mixLockable);
+            testRootNode.save();
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        assertTrue("Adding 2 mixins at once -> both must be present.", node.isNodeType(mixReferenceable) && node.isNodeType(mixLockable));
+        List mixins = Arrays.asList(node.getMixinNodeTypes());
+        assertTrue("Adding 2 mixins at once -> both must be present.", mixins.contains(ntMgr.getNodeType(mixReferenceable)) && mixins.contains(ntMgr.getNodeType(mixLockable)));
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/AddMixinTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.jcr2spi.nodetype;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Node;
+import javax.jcr.nodetype.NodeTypeManager;
+import java.util.List;
+import java.util.Arrays;
+
+/**
+ * <code>RemoveMixinTest</code>...
+ */
+public class RemoveMixinTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(RemoveMixinTest.class);
+
+    private NodeTypeManager ntMgr;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        ntMgr = testRootNode.getSession().getWorkspace().getNodeTypeManager();
+    }
+
+    /**
+     * Implementation specific test for 'removeMixin' only taking effect upon
+     * save.
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testRemoveMixinTakingAffectUponSave() throws NotExecutableException, RepositoryException {
+        Node node;
+        try {
+            node = testRootNode.addNode(nodeName1, testNodeType);
+            node.addMixin(mixReferenceable);
+            testRootNode.save();
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        node.removeMixin(mixReferenceable);
+        assertTrue("Removing Mixin must not take effect but after Node has been saved.", node.isNodeType(mixReferenceable));
+        List mixins = Arrays.asList(node.getMixinNodeTypes());
+        assertTrue("Removing Mixin must not take effect but after Node has been saved.", mixins.contains(ntMgr.getNodeType(mixReferenceable)));
+    }
+
+    /**
+     * Implementation specific test
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testAddAndRemoveMixinFromNew() throws NotExecutableException, RepositoryException {
+        Node node;
+        try {
+            node = testRootNode.addNode(nodeName1, testNodeType);
+            node.addMixin(mixReferenceable);
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        node.removeMixin(mixReferenceable);
+        testRootNode.save();
+
+        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", node.isNodeType(mixReferenceable));
+        List mixins = Arrays.asList(node.getMixinNodeTypes());
+        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", mixins.contains(ntMgr.getNodeType(mixReferenceable)));
+    }
+
+    /**
+     * Implementation specific test
+     *
+     * @throws NotExecutableException
+     * @throws RepositoryException
+     */
+    public void testAddAndRemoveMixin() throws NotExecutableException, RepositoryException {
+        Node node;
+        try {
+            node = testRootNode.addNode(nodeName1, testNodeType);
+            testRootNode.save();
+        } catch (RepositoryException e) {
+            throw new NotExecutableException();
+        }
+
+        node.addMixin(mixReferenceable);
+        node.removeMixin(mixReferenceable);
+        testRootNode.save();
+
+        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", node.isNodeType(mixReferenceable));
+        List mixins = Arrays.asList(node.getMixinNodeTypes());
+        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", mixins.contains(ntMgr.getNodeType(mixReferenceable)));
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/nodetype/RemoveMixinTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.api.NamespaceRegistryReadMethodsTest;
+import org.apache.jackrabbit.test.api.NamespaceRemappingTest;
+import org.apache.jackrabbit.test.api.RepositoryDescriptorTest;
+import org.apache.jackrabbit.test.api.SessionReadMethodsTest;
+import org.apache.jackrabbit.test.api.WorkspaceReadMethodsTest;
+import org.apache.jackrabbit.test.api.ExportSysViewTest;
+import org.apache.jackrabbit.test.api.ExportDocViewTest;
+import org.apache.jackrabbit.test.api.RepositoryLoginTest;
+import org.apache.jackrabbit.test.api.ImpersonateTest;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+
+/**
+ * <code>TestGeneralRead</code>...
+ */
+public class TestGeneralRead extends TestCase {
+
+    private static Logger log = LoggerFactory.getLogger(TestGeneralRead.class);
+
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("javax.jcr General-Read");
+
+        suite.addTestSuite(NamespaceRegistryReadMethodsTest.class);
+        suite.addTestSuite(NamespaceRemappingTest.class);
+        suite.addTestSuite(RepositoryDescriptorTest.class);
+        suite.addTestSuite(SessionReadMethodsTest.class);
+        suite.addTestSuite(WorkspaceReadMethodsTest.class);
+
+        suite.addTestSuite(ExportSysViewTest.class);
+        suite.addTestSuite(ExportDocViewTest.class);
+
+        suite.addTestSuite(RepositoryLoginTest.class);
+        suite.addTestSuite(ImpersonateTest.class);
+
+
+        return suite;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralRead.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,94 @@
+/*
+ * $Id$
+ *
+ * Copyright 1997-2005 Day Management AG
+ * Barfuesserplatz 6, 4001 Basel, Switzerland
+ * All Rights Reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Day Management AG, ("Confidential Information"). You shall not
+ * disclose such Confidential Information and shall use it only in
+ * accordance with the terms of the license agreement you entered into
+ * with Day.
+ */
+package org.apache.jackrabbit.test;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.api.NamespaceRegistryTest;
+import org.apache.jackrabbit.test.api.SessionTest;
+import org.apache.jackrabbit.test.api.SessionUUIDTest;
+import org.apache.jackrabbit.test.api.WorkspaceCloneReferenceableTest;
+import org.apache.jackrabbit.test.api.WorkspaceCloneSameNameSibsTest;
+import org.apache.jackrabbit.test.api.WorkspaceCloneTest;
+import org.apache.jackrabbit.test.api.WorkspaceCloneVersionableTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyBetweenWorkspacesReferenceableTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyBetweenWorkspacesSameNameSibsTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyBetweenWorkspacesTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyBetweenWorkspacesVersionableTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyReferenceableTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopySameNameSibsTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyTest;
+import org.apache.jackrabbit.test.api.WorkspaceCopyVersionableTest;
+import org.apache.jackrabbit.test.api.WorkspaceMoveReferenceableTest;
+import org.apache.jackrabbit.test.api.WorkspaceMoveSameNameSibsTest;
+import org.apache.jackrabbit.test.api.WorkspaceMoveTest;
+import org.apache.jackrabbit.test.api.WorkspaceMoveVersionableTest;
+import org.apache.jackrabbit.test.api.DocumentViewImportTest;
+import org.apache.jackrabbit.test.api.SerializationTest;
+import org.apache.jackrabbit.test.api.ValueFactoryTest;
+import org.apache.jackrabbit.test.api.CheckPermissionTest;
+
+/**
+ * <code>TestAllPropertyRead</code>...
+ */
+public class TestGeneralWrite extends TestCase {
+
+    private static Logger log = LoggerFactory.getLogger(TestGeneralWrite.class);
+
+    /**
+     * Returns a <code>Test</code> suite that executes all tests inside this
+     * package.
+     *
+     * @return a <code>Test</code> suite that executes all tests inside this
+     *         package.
+     */
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("javax.jcr General-Write");
+
+        suite.addTestSuite(CheckPermissionTest.class);
+
+        suite.addTestSuite(NamespaceRegistryTest.class);
+
+        suite.addTestSuite(SessionTest.class);
+        suite.addTestSuite(SessionUUIDTest.class);
+
+        suite.addTestSuite(WorkspaceCloneReferenceableTest.class);
+        suite.addTestSuite(WorkspaceCloneSameNameSibsTest.class);
+        suite.addTestSuite(WorkspaceCloneTest.class);
+        suite.addTestSuite(WorkspaceCloneVersionableTest.class);
+        suite.addTestSuite(WorkspaceCopyBetweenWorkspacesReferenceableTest.class);
+        suite.addTestSuite(WorkspaceCopyBetweenWorkspacesSameNameSibsTest.class);
+        suite.addTestSuite(WorkspaceCopyBetweenWorkspacesTest.class);
+        suite.addTestSuite(WorkspaceCopyBetweenWorkspacesVersionableTest.class);
+        suite.addTestSuite(WorkspaceCopyReferenceableTest.class);
+        suite.addTestSuite(WorkspaceCopySameNameSibsTest.class);
+        suite.addTestSuite(WorkspaceCopyTest.class);
+        suite.addTestSuite(WorkspaceCopyVersionableTest.class);
+        suite.addTestSuite(WorkspaceMoveReferenceableTest.class);
+        suite.addTestSuite(WorkspaceMoveSameNameSibsTest.class);
+        suite.addTestSuite(WorkspaceMoveTest.class);
+        suite.addTestSuite(WorkspaceMoveVersionableTest.class);
+
+        suite.addTestSuite(DocumentViewImportTest.class);
+        suite.addTestSuite(SerializationTest.class);
+
+        suite.addTestSuite(ValueFactoryTest.class);
+
+        return suite;
+    }
+}

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestGeneralWrite.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.api.RootNodeTest;
+import org.apache.jackrabbit.test.api.NodeReadMethodsTest;
+import org.apache.jackrabbit.test.api.NodeDiscoveringNodeTypesTest;
+import org.apache.jackrabbit.test.api.NodeIteratorTest;
+import org.apache.jackrabbit.test.api.ReferenceableRootNodesTest;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+
+/**
+ * <code>TestNodeRead</code>...
+ */
+public class TestNodeRead extends TestCase {
+
+    private static Logger log = LoggerFactory.getLogger(TestNodeRead.class);
+
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("javax.jcr Node-Read");
+
+        suite.addTestSuite(RootNodeTest.class);
+        suite.addTestSuite(NodeReadMethodsTest.class);
+        suite.addTestSuite(NodeDiscoveringNodeTypesTest.class);
+        suite.addTestSuite(NodeIteratorTest.class);
+        suite.addTestSuite(ReferenceableRootNodesTest.class);
+
+        return suite;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeRead.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.api.AddNodeTest;
+import org.apache.jackrabbit.test.api.NodeTest;
+import org.apache.jackrabbit.test.api.NodeUUIDTest;
+import org.apache.jackrabbit.test.api.NodeOrderableChildNodesTest;
+import org.apache.jackrabbit.test.api.ReferencesTest;
+import org.apache.jackrabbit.test.api.NodeItemIsModifiedTest;
+import org.apache.jackrabbit.test.api.NodeItemIsNewTest;
+import org.apache.jackrabbit.test.api.NodeAddMixinTest;
+import org.apache.jackrabbit.test.api.NodeCanAddMixinTest;
+import org.apache.jackrabbit.test.api.NodeRemoveMixinTest;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * <code>TestNodeWrite</code>...
+ */
+public class TestNodeWrite {
+
+    private static Logger log = LoggerFactory.getLogger(TestNodeWrite.class);
+
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("javax.jcr Node-Write");
+        suite.addTestSuite(AddNodeTest.class);
+        suite.addTestSuite(NodeTest.class);
+        suite.addTestSuite(NodeUUIDTest.class);
+        suite.addTestSuite(NodeOrderableChildNodesTest.class);
+        suite.addTestSuite(ReferencesTest.class);
+        suite.addTestSuite(NodeItemIsModifiedTest.class);
+        suite.addTestSuite(NodeItemIsNewTest.class);
+
+        suite.addTestSuite(NodeAddMixinTest.class);
+        suite.addTestSuite(NodeCanAddMixinTest.class);
+        suite.addTestSuite(NodeRemoveMixinTest.class);
+
+        return suite;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestNodeWrite.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.api.PropertyTypeTest;
+import org.apache.jackrabbit.test.api.BinaryPropertyTest;
+import org.apache.jackrabbit.test.api.BooleanPropertyTest;
+import org.apache.jackrabbit.test.api.DatePropertyTest;
+import org.apache.jackrabbit.test.api.DoublePropertyTest;
+import org.apache.jackrabbit.test.api.LongPropertyTest;
+import org.apache.jackrabbit.test.api.NamePropertyTest;
+import org.apache.jackrabbit.test.api.PathPropertyTest;
+import org.apache.jackrabbit.test.api.ReferencePropertyTest;
+import org.apache.jackrabbit.test.api.StringPropertyTest;
+import org.apache.jackrabbit.test.api.UndefinedPropertyTest;
+import org.apache.jackrabbit.test.api.PropertyReadMethodsTest;
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * <code>TestPropertyRead</code>...
+ */
+public class TestPropertyRead extends TestCase {
+
+    private static Logger log = LoggerFactory.getLogger(TestPropertyRead.class);
+
+    /**
+     * Returns a <code>Test</code> suite that executes all tests inside this
+     * package.
+     *
+     * @return a <code>Test</code> suite that executes all tests inside this
+     *         package.
+     */
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("javax.jcr Property-Read");
+
+        suite.addTestSuite(PropertyTypeTest.class);
+        suite.addTestSuite(BinaryPropertyTest.class);
+        suite.addTestSuite(BooleanPropertyTest.class);
+        suite.addTestSuite(DatePropertyTest.class);
+        suite.addTestSuite(DoublePropertyTest.class);
+        suite.addTestSuite(LongPropertyTest.class);
+        suite.addTestSuite(NamePropertyTest.class);
+        suite.addTestSuite(PathPropertyTest.class);
+        suite.addTestSuite(ReferencePropertyTest.class);
+        suite.addTestSuite(StringPropertyTest.class);
+        suite.addTestSuite(UndefinedPropertyTest.class);
+        suite.addTestSuite(PropertyReadMethodsTest.class);
+
+        return suite;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyRead.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java?view=auto&rev=506915
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java (added)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java Tue Feb 13 01:02:11 2007
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * 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 License.
+ */
+package org.apache.jackrabbit.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.api.PropertyTest;
+import org.apache.jackrabbit.test.api.SetValueBinaryTest;
+import org.apache.jackrabbit.test.api.SetValueBooleanTest;
+import org.apache.jackrabbit.test.api.SetValueDateTest;
+import org.apache.jackrabbit.test.api.SetValueDoubleTest;
+import org.apache.jackrabbit.test.api.SetValueLongTest;
+import org.apache.jackrabbit.test.api.SetValueReferenceTest;
+import org.apache.jackrabbit.test.api.SetValueStringTest;
+import org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest;
+import org.apache.jackrabbit.test.api.SetValueValueFormatExceptionTest;
+import org.apache.jackrabbit.test.api.SetValueVersionExceptionTest;
+import org.apache.jackrabbit.test.api.SetPropertyBooleanTest;
+import org.apache.jackrabbit.test.api.SetPropertyCalendarTest;
+import org.apache.jackrabbit.test.api.SetPropertyDoubleTest;
+import org.apache.jackrabbit.test.api.SetPropertyInputStreamTest;
+import org.apache.jackrabbit.test.api.SetPropertyLongTest;
+import org.apache.jackrabbit.test.api.SetPropertyNodeTest;
+import org.apache.jackrabbit.test.api.SetPropertyStringTest;
+import org.apache.jackrabbit.test.api.SetPropertyValueTest;
+import org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest;
+import org.apache.jackrabbit.test.api.SetPropertyAssumeTypeTest;
+import org.apache.jackrabbit.test.api.PropertyItemIsModifiedTest;
+import org.apache.jackrabbit.test.api.PropertyItemIsNewTest;
+import junit.framework.TestSuite;
+import junit.framework.Test;
+import junit.framework.TestCase;
+
+/**
+ * <code>TestPropertyWrite</code>...
+ */
+public class TestPropertyWrite extends TestCase {
+
+    private static Logger log = LoggerFactory.getLogger(TestPropertyWrite.class);
+
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("javax.jcr Property-Write");
+
+        suite.addTestSuite(PropertyTest.class);
+
+        suite.addTestSuite(SetValueBinaryTest.class);
+        suite.addTestSuite(SetValueBooleanTest.class);
+        suite.addTestSuite(SetValueDateTest.class);
+        suite.addTestSuite(SetValueDoubleTest.class);
+        suite.addTestSuite(SetValueLongTest.class);
+        suite.addTestSuite(SetValueReferenceTest.class);
+        suite.addTestSuite(SetValueStringTest.class);
+        suite.addTestSuite(SetValueConstraintViolationExceptionTest.class);
+        suite.addTestSuite(SetValueValueFormatExceptionTest.class);
+        suite.addTestSuite(SetValueVersionExceptionTest.class);
+
+        suite.addTestSuite(SetPropertyBooleanTest.class);
+        suite.addTestSuite(SetPropertyCalendarTest.class);
+        suite.addTestSuite(SetPropertyDoubleTest.class);
+        suite.addTestSuite(SetPropertyInputStreamTest.class);
+        suite.addTestSuite(SetPropertyLongTest.class);
+        suite.addTestSuite(SetPropertyNodeTest.class);
+        suite.addTestSuite(SetPropertyStringTest.class);
+        suite.addTestSuite(SetPropertyValueTest.class);
+        suite.addTestSuite(SetPropertyConstraintViolationExceptionTest.class);
+        suite.addTestSuite(SetPropertyAssumeTypeTest.class);
+
+        suite.addTestSuite(PropertyItemIsModifiedTest.class);
+        suite.addTestSuite(PropertyItemIsNewTest.class);
+
+        return suite;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/test/TestPropertyWrite.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url



Mime
View raw message