[jbosscache-commits] JBoss Cache SVN: r5846 - core/trunk/src/test/java/org/jboss/cache/optimistic.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed May 14 08:40:27 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-05-14 08:40:27 -0400 (Wed, 14 May 2008)
New Revision: 5846

Modified:
   core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java
Log:
Fixed broken test

Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java	2008-05-14 12:16:14 UTC (rev 5845)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncFullStackInterceptorTest.java	2008-05-14 12:40:27 UTC (rev 5846)
@@ -1,7 +1,5 @@
 package org.jboss.cache.optimistic;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.NodeSPI;
@@ -14,6 +12,7 @@
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.Test;
 
+import javax.transaction.RollbackException;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
@@ -24,7 +23,6 @@
 public class AsyncFullStackInterceptorTest extends AbstractOptimisticTestCase
 {
 
-   private Log log = LogFactory.getLog(AsyncFullStackInterceptorTest.class);
 
    /**
     * @param name
@@ -147,7 +145,15 @@
       mgr.resume(tx);
 
       // one-phase-commits wont throw an exception on failure.
-      mgr.commit();
+      try
+      {
+         mgr.commit();
+         assert false : "Expecting an exception";
+      }
+      catch (RollbackException expected)
+      {
+         // this is good
+      }
 
       assertNull(mgr.getTransaction());
       assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
@@ -341,8 +347,15 @@
 
       mgr.resume(tx);
 
-      // 1-pc commits wont throw an exception if there is a problem.
-      mgr.commit();
+      try
+      {
+         mgr.commit();
+         assert false : "Expecting an exception";
+      }
+      catch (RollbackException expected)
+      {
+         // this is good
+      }
 
       assertNull(mgr.getTransaction());
       assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());




More information about the jbosscache-commits mailing list