Author: angela
Date: Thu Jun 25 13:17:11 2009
New Revision: 788350
URL: http://svn.apache.org/viewvc?rev=788350&view=rev
Log:
XATest: Add missing Session.logout to prevent ERROR in jcr.log
Modified:
jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java
Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java?rev=788350&r1=788349&r2=788350&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java
Thu Jun 25 13:17:11 2009
@@ -1009,35 +1009,39 @@
assertNull("session must get a null lock token", lock.getLockToken());
Session other = helper.getSuperuserSession();
- // start new Transaction and try to add lock token
- utx = new UserTransactionImpl(other);
- utx.begin();
-
- Node otherNode = other.getNodeByUUID(uuid);
- assertTrue("Node not locked", otherNode.isLocked());
try {
- otherNode.setProperty(propertyName1, "foo");
- fail("Lock exception should be thrown");
- } catch (LockException e) {
- // expected
- }
+ // start new Transaction and try to add lock token
+ utx = new UserTransactionImpl(other);
+ utx.begin();
- // add lock token
- other.addLockToken(lockToken);
+ Node otherNode = other.getNodeByUUID(uuid);
+ assertTrue("Node not locked", otherNode.isLocked());
+ try {
+ otherNode.setProperty(propertyName1, "foo");
+ fail("Lock exception should be thrown");
+ } catch (LockException e) {
+ // expected
+ }
- // refresh Lock Info
- lock = otherNode.getLock();
+ // add lock token
+ other.addLockToken(lockToken);
- // assert: session must hold lock token
- assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));
+ // refresh Lock Info
+ lock = otherNode.getLock();
- otherNode.unlock();
+ // assert: session must hold lock token
+ assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));
- assertFalse("Node is locked", otherNode.isLocked());
+ otherNode.unlock();
- otherNode.setProperty(propertyName1, "foo");
- other.save();
- utx.commit();
+ assertFalse("Node is locked", otherNode.isLocked());
+
+ otherNode.setProperty(propertyName1, "foo");
+ other.save();
+ utx.commit();
+ } finally {
+ other.logout();
+ }
}
/**
|