jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r771295 - in /jackrabbit/trunk: jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/
Date Mon, 04 May 2009 13:03:30 GMT
Author: reschke
Date: Mon May  4 13:03:29 2009
New Revision: 771295

URL: http://svn.apache.org/viewvc?rev=771295&view=rev
Log:
JCR-2085: move new locking tests

Added:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
      - copied, changed from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/AbstractLockTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/DeepLockTest.java
      - copied, changed from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/DeepLockTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockManagerTest.java
      - copied, changed from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/LockManagerTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/OpenScopedLockTest.java
      - copied, changed from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/OpenScopedLockTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/SessionScopedLockTest.java
      - copied, changed from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/SessionScopedLockTest.java
Removed:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/AbstractLockTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/DeepLockTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/LockManagerTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/OpenScopedLockTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/SessionScopedLockTest.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/TestAll.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/TestAll.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/TestAll.java?rev=771295&r1=771294&r2=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/TestAll.java
Mon May  4 13:03:29 2009
@@ -30,11 +30,6 @@
     public static Test suite() {
         TestSuite suite = new TestSuite("javax.jcr.lock tests");
 
-        suite.addTestSuite(LockManagerTest.class);
-        suite.addTestSuite(OpenScopedLockTest.class);
-        suite.addTestSuite(SessionScopedLockTest.class);
-        suite.addTestSuite(DeepLockTest.class);
-
         return suite;
     }
 }
\ No newline at end of file

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
(from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/AbstractLockTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/AbstractLockTest.java&r1=771283&r2=771295&rev=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/AbstractLockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
Mon May  4 13:03:29 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.api.jsr283.lock;
+package org.apache.jackrabbit.test.api.lock;
 
 import javax.jcr.Node;
 import javax.jcr.Repository;
@@ -27,7 +27,6 @@
 import javax.jcr.observation.Event;
 import javax.jcr.observation.ObservationManager;
 
-import org.apache.jackrabbit.core.WorkspaceImpl;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.JUnitTest;
 import org.apache.jackrabbit.test.NotExecutableException;
@@ -98,8 +97,7 @@
     }
 
     private static LockManager getLockManager(Session session) throws RepositoryException
{
-        // TODO: rm cast and adjust call as soon as 283 is released
-        return ((WorkspaceImpl) session.getWorkspace()).getLockManager();
+        return session.getWorkspace().getLockManager();
     }
 
     /**
@@ -152,12 +150,12 @@
      */
     public void testIsLockOwningSession() throws RepositoryException {
         assertTrue("Session must be lock owner", lock.isLockOwningSession());
-        assertTrue("Session must be lock owner", ((Lock) lockedNode.getLock()).isLockOwningSession());
+        assertTrue("Session must be lock owner", lockedNode.getLock().isLockOwningSession());
         assertTrue("Session must be lock owner", lockMgr.getLock(lockedNode.getPath()).isLockOwningSession());
 
         Session otherSession = helper.getReadOnlySession();
         try {
-            Lock lck = (Lock) ((Node) otherSession.getItem(lockedNode.getPath())).getLock();
+            Lock lck = otherSession.getNode(lockedNode.getPath()).getLock();
             assertFalse("Session must not be lock owner", lck.isLockOwningSession());
 
             Lock lck2 = getLockManager(otherSession).getLock(lockedNode.getPath());
@@ -168,7 +166,7 @@
 
         Session otherAdmin = helper.getSuperuserSession();
         try {
-            Lock lck = (Lock) ((Node) otherAdmin.getItem(lockedNode.getPath())).getLock();
+            Lock lck = otherAdmin.getNode(lockedNode.getPath()).getLock();
             assertFalse("Other Session for the same userID must not be lock owner", lck.isLockOwningSession());
 
             Lock lck2 = getLockManager(otherAdmin).getLock(lockedNode.getPath());
@@ -291,7 +289,7 @@
     public void testGetLockOnChild() throws RepositoryException {
         if (isDeep()) {
             // get lock must succeed even if child is not lockable.
-            javax.jcr.lock.Lock lock = childNode.getLock();
+            Lock lock = childNode.getLock();
             assertNotNull(lock);
             assertTrue("Lock.getNode() must return the lock holding node", lockedNode.isSame(lock.getNode()));
 
@@ -318,7 +316,7 @@
         Node newChild = lockedNode.addNode(nodeName3, testNodeType);
         if (isDeep()) {
             // get lock must succeed even if child is not lockable.
-            javax.jcr.lock.Lock lock = newChild.getLock();
+            Lock lock = newChild.getLock();
             assertNotNull(lock);
             assertTrue("Lock.getNode() must return the lock holding node", lockedNode.isSame(lock.getNode()));
 

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/DeepLockTest.java
(from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/DeepLockTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/DeepLockTest.java?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/DeepLockTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/DeepLockTest.java&r1=771283&r2=771295&rev=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/DeepLockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/DeepLockTest.java
Mon May  4 13:03:29 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.api.jsr283.lock;
+package org.apache.jackrabbit.test.api.lock;
 
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockManagerTest.java
(from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/LockManagerTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockManagerTest.java?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockManagerTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/LockManagerTest.java&r1=771283&r2=771295&rev=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/LockManagerTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/LockManagerTest.java
Mon May  4 13:03:29 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.api.jsr283.lock;
+package org.apache.jackrabbit.test.api.lock;
 
 import java.util.Arrays;
 import java.util.List;
@@ -28,7 +28,6 @@
 import javax.jcr.lock.LockException;
 import javax.jcr.lock.LockManager;
 
-import org.apache.jackrabbit.core.WorkspaceImpl;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
@@ -74,8 +73,7 @@
     }
 
    private static LockManager getLockManager(Session session) throws RepositoryException
{
-        // TODO: rm cast and adjust call as soon as 283 is released
-        return ((WorkspaceImpl) session.getWorkspace()).getLockManager();
+        return session.getWorkspace().getLockManager();
     }
 
     private static boolean containsLockToken(LockManager lMgr, String token) throws RepositoryException
{

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/OpenScopedLockTest.java
(from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/OpenScopedLockTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/OpenScopedLockTest.java?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/OpenScopedLockTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/OpenScopedLockTest.java&r1=771283&r2=771295&rev=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/OpenScopedLockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/OpenScopedLockTest.java
Mon May  4 13:03:29 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.api.jsr283.lock;
+package org.apache.jackrabbit.test.api.lock;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/SessionScopedLockTest.java
(from r771283, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/SessionScopedLockTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/SessionScopedLockTest.java?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/SessionScopedLockTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/SessionScopedLockTest.java&r1=771283&r2=771295&rev=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/lock/SessionScopedLockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/SessionScopedLockTest.java
Mon May  4 13:03:29 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.api.jsr283.lock;
+package org.apache.jackrabbit.test.api.lock;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/TestAll.java?rev=771295&r1=771294&r2=771295&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/TestAll.java
Mon May  4 13:03:29 2009
@@ -37,8 +37,15 @@
         TestSuite suite = new TestSuite("javax.jcr.lock tests");
 
         suite.addTestSuite(LockTest.class);
-	suite.addTestSuite(SetValueLockExceptionTest.class);
+        suite.addTestSuite(SetValueLockExceptionTest.class);
 
+        // JCR 2.0 tests
+        
+        suite.addTestSuite(DeepLockTest.class);
+        suite.addTestSuite(LockManagerTest.class);
+        suite.addTestSuite(OpenScopedLockTest.class);
+        suite.addTestSuite(SessionScopedLockTest.class);
+        
         return suite;
     }
 }



Mime
View raw message