From jbosscache-commits at lists.jboss.org Fri Sep 14 13:18:11 2007 Content-Type: multipart/mixed; boundary="===============2918402189645295733==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r4464 - core/branches/1.4.X/tests/functional/org/jboss/cache/transaction. Date: Fri, 14 Sep 2007 13:18:10 -0400 Message-ID: --===============2918402189645295733== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: manik.surtani(a)jboss.com Date: 2007-09-14 13:18:10 -0400 (Fri, 14 Sep 2007) New Revision: 4464 Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/AsyncRo= llbackTxLockTest.java Log: Enhanced test for JBCACHE-1183 Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/= AsyncRollbackTxLockTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/AsyncR= ollbackTxLockTest.java 2007-09-14 16:00:29 UTC (rev 4463) +++ core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/AsyncR= ollbackTxLockTest.java 2007-09-14 17:18:10 UTC (rev 4464) @@ -2,6 +2,7 @@ = import junit.framework.TestCase; import org.jboss.cache.TreeCache; +import org.jboss.cache.lock.LockingException; = import javax.transaction.Synchronization; import javax.transaction.SystemException; @@ -9,7 +10,18 @@ import javax.transaction.TransactionManager; = /** - * Test behaviour of async rollback timeouted transaction + * Test behaviour of async rollback of a tx that times out and subsequent = operations on that transaction. + *

+ * NOTE: To run this test, add the following lines: + *

+ * + *

+ *

+ * if ("Thread-0".equals(Thread.currentThread().getName())) Thread.sleep(1= 500); + *

+ * + *

+ * to the first line of PessimistickLockInterceptor#recordNodeLock() * * @author Jacek Halat */ @@ -78,7 +90,15 @@ }); assertNotNull(tm.getTransaction()); Thread.sleep(500);//transaction should be rolledback in another thre= ad - cache.put("/a", "k", "v"); + try + { + cache.put("/a", "k", "v"); + } + catch (LockingException expected) + { + // this is normal; the tx would have timed out and obtaining lock= s for this tx should fail. + } + tm.rollback(); assertNull(tm.getTransaction()); assertEquals(0, cache.getNumberOfLocksHeld()); --===============2918402189645295733==--