You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by an...@apache.org on 2007/07/11 16:25:04 UTC
svn commit: r555284 -
/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/lock/AbstractLockTest.java
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.");
+ }
}