Author: manik.surtani(a)jboss.com
Date: 2008-05-29 08:43:40 -0400 (Thu, 29 May 2008)
New Revision: 5912
Modified:
core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java
Log:
Removed unnecessary try-catch blocks
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java 2008-05-29
12:35:27 UTC (rev 5911)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java 2008-05-29
12:43:40 UTC (rev 5912)
@@ -19,8 +19,8 @@
import org.jboss.cache.lock.LockManager;
import static org.jboss.cache.lock.LockType.READ;
import static org.jboss.cache.lock.LockType.WRITE;
-import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.util.CachePrinter;
+import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -366,44 +366,30 @@
assertLocked(gtx, "/a/b/c", true);
}
- public void testNodeRemoval()
+ public void testNodeRemoval() throws SystemException, NotSupportedException
{
GlobalTransaction gtx;
- try
- {
- cache.put("/a/b/c", null);
- tx.begin();
- gtx = cache.getCurrentTransaction();
- cache.removeNode("/a/b/c");// need to remove the node, not just the
data in the node.
- assertLocked(gtx, "/a", false);
- assertLocked(gtx, "/a/b", true);
- assertLocked(gtx, "/a/b/c", true);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail(t.toString());
- }
+ cache.put("/a/b/c", null);
+ tx.begin();
+ gtx = cache.getCurrentTransaction();
+ cache.removeNode("/a/b/c");// need to remove the node, not just the data
in the node.
+ assertLocked(gtx, "/a", false);
+ assertLocked(gtx, "/a/b", true);
+ assertLocked(gtx, "/a/b/c", true);
+ tx.rollback();
}
- public void testNodeRemoval2()
+ public void testNodeRemoval2() throws SystemException, NotSupportedException
{
GlobalTransaction gtx;
- try
- {
- cache.put("/a/b/c", null);
- tx.begin();
- gtx = cache.getCurrentTransaction();
- cache.removeNode("/a/b");// need to remove the node, not just the data
in the node.
- assertLocked(gtx, "/a", true);
- assertLocked(gtx, "/a/b", true);
- assertLocked(gtx, "/a/b/c", true);
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- fail(t.toString());
- }
+ cache.put("/a/b/c", null);
+ tx.begin();
+ gtx = cache.getCurrentTransaction();
+ cache.removeNode("/a/b");// need to remove the node, not just the data in
the node.
+ assertLocked(gtx, "/a", true);
+ assertLocked(gtx, "/a/b", true);
+ assertLocked(gtx, "/a/b/c", true);
+ tx.rollback();
}
public void testIntermediateNodeCreationOnWrite() throws Exception
@@ -417,7 +403,6 @@
assertLocked(gtx, "/a/b", true);
assertLocked(gtx, "/a/b/c", true);
tx.rollback();
-
}
public void testIntermediateNodeCreationOnRead() throws Exception
@@ -537,11 +522,11 @@
assertTrue("node " + fqn + " is not locked",
lockManager.isLocked(n));
if (writeLocked)
{
- assertTrue("node " + fqn + " is not write-locked by owner "
+ owner, lockManager.ownsLock(Fqn.fromString(fqn), WRITE, owner));
+ assertTrue("node " + fqn + " is not write-locked by owner "
+ owner + ". Lock details: " + lockManager.printLockInfo(n),
lockManager.ownsLock(Fqn.fromString(fqn), WRITE, owner));
}
else
{
- assertTrue("node " + fqn + " is not read-locked by owner " +
owner, lockManager.ownsLock(Fqn.fromString(fqn), READ, owner));
+ assertTrue("node " + fqn + " is not read-locked by owner " +
owner + ". Lock details: " + lockManager.printLockInfo(n),
lockManager.ownsLock(Fqn.fromString(fqn), READ, owner));
}
}