From jbosscache-commits at lists.jboss.org Mon Oct 8 11:48:51 2007 Content-Type: multipart/mixed; boundary="===============8726298779347892471==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r4566 - core/trunk/src/test/java/org/jboss/cache/transaction. Date: Mon, 08 Oct 2007 11:48:51 -0400 Message-ID: --===============8726298779347892471== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: manik.surtani(a)jboss.com Date: 2007-10-08 11:48:51 -0400 (Mon, 08 Oct 2007) New Revision: 4566 Removed: core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTxLock= Test.java Modified: core/trunk/src/test/java/org/jboss/cache/transaction/SimultaneousRollbac= kAndPutTest.java Log: Commented on why tests are disabled - linked to JIRA tasks. Deleted: core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollback= TxLockTest.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/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTxLoc= kTest.java 2007-10-08 15:43:54 UTC (rev 4565) +++ core/trunk/src/test/java/org/jboss/cache/transaction/AsyncRollbackTxLoc= kTest.java 2007-10-08 15:48:51 UTC (rev 4566) @@ -1,98 +0,0 @@ -package org.jboss.cache.transaction; - -import junit.framework.TestCase; - - -import javax.transaction.Synchronization; -import javax.transaction.SystemException; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; - -import org.jboss.cache.Cache; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.CacheImpl; -import org.jboss.cache.Fqn; -import org.testng.annotations.Test; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeMethod; - -/** - * Test behaviour of async rollback timeouted transaction - * - * @author Jacek Halat - */ -(a)Test(groups =3D {"functional"}) -public class AsyncRollbackTxLockTest -{ - private Cache cache; - private TransactionManager tm; - - - @BeforeMethod(alwaysRun =3D true) - public void setUp() throws Exception - { - cache =3D DefaultCacheFactory.getInstance().createCache(false); - - cache.getConfiguration().setTransactionManagerLookupClass(AsyncRollb= ackTransactionManagerLookup.class.getName()); - cache.start(); - tm =3D cache.getConfiguration().getRuntimeConfig().getTransactionMan= ager(); - tm.setTransactionTimeout(2); - } - - @AfterMethod(alwaysRun =3D true) - public void tearDown() - { - try - { - if (tm !=3D null && tm.getTransaction() !=3D null) - { - try - { - tm.rollback(); - } - catch (SystemException e) - { - // do nothing - } - } - } - catch (SystemException e) - { - // do nothing - } - if (cache !=3D null) cache.stop(); - cache =3D null; - tm =3D null; - } - - - public void testTxTimeoutAndRemovePutAfter() throws Exception - { - Thread.currentThread().setName("Thread-0"); - System.out.println("Main Thread:"+Thread.currentThread()); - assert 0 =3D=3D ((CacheImpl) cache).getNumberOfLocksHeld(); - tm.setTransactionTimeout(1);//short transaction timeout - cache.put(Fqn.fromString("/a/b/c/d"), "k", "v"); - tm.begin(); - Transaction transaction =3D tm.getTransaction(); - transaction.registerSynchronization(new Synchronization(){ - - public void afterCompletion(int arg0) { - System.out.println("Synchronization Thread:"+Thread.currentThread()); - } - - public void beforeCompletion() { - } - - }); - assert tm.getTransaction() !=3D null; - Thread.sleep(500);//transaction should be rolledback in another thr= ead - cache.put(Fqn.fromString("/a"), "k", "v"); - tm.rollback(); - assert tm.getTransaction() =3D=3D null; - assert 0 =3D=3D ((CacheImpl) cache).getNumberOfLocksHeld(); - cache.put(Fqn.fromString("/a"), "k", "v"); - } - -} - Modified: core/trunk/src/test/java/org/jboss/cache/transaction/Simultaneous= RollbackAndPutTest.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/trunk/src/test/java/org/jboss/cache/transaction/SimultaneousRollba= ckAndPutTest.java 2007-10-08 15:43:54 UTC (rev 4565) +++ core/trunk/src/test/java/org/jboss/cache/transaction/SimultaneousRollba= ckAndPutTest.java 2007-10-08 15:48:51 UTC (rev 4566) @@ -20,7 +20,7 @@ * * @author Manik Surtani */ -(a)Test(groups =3D {"functional", "transaction"}, enabled =3D false) +(a)Test(groups =3D {"functional", "transaction"}, enabled =3D false) // Kn= own issue - disabled because of JBCACHE-923 public class SimultaneousRollbackAndPutTest { private Cache cache; --===============8726298779347892471==--