jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r555284 - /jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
Date Wed, 11 Jul 2007 14:25:04 GMT
Author: angela
Date: Wed Jul 11 07:25:02 2007
New Revision: 555284

URL: http://svn.apache.org/viewvc?view=rev&rev=555284
Log:
Tests

Modified:
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java

Modified: 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=diff&rev=555284&r1=555283&r2=555284
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
(original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
Wed Jul 11 07:25:02 2007
@@ -308,4 +308,25 @@
             // OK
         }
     }
+
+    /**
+     * Test if the lock token has been automatically added to the set of lock
+     * tokens present with the Session that created the new Lock.
+     * 
+     * @throws RepositoryException
+     */
+    public void testLockTokenPresentWithSession() throws RepositoryException {
+        String token = lock.getLockToken();
+        String[] allTokens = lockedNode.getSession().getLockTokens();
+        for (int i = 0; i < allTokens.length; i++) {
+            if (allTokens[i].equals(token)) {
+                // lock token is present with the session that applied the lock
+                // OK
+                return;
+            }
+        }
+
+        // lock token not present within tokens returned by Session.getLockTokens.
+        fail("Upon successful call to Node.lock, the lock token must automatically be added
to the set of tokens held by the Session.");
+    }
 }



Mime
View raw message