[jboss-cvs] JBossAS SVN: r63572 - in branches/Branch_4_2/ejb3/src: test/org/jboss/ejb3/test/jbas4489 and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 19 13:12:31 EDT 2007


Author: wolfc
Date: 2007-06-19 13:12:30 -0400 (Tue, 19 Jun 2007)
New Revision: 63572

Modified:
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/tx/BMTInterceptor.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java
Log:
JBAS-4489: check for exception

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/tx/BMTInterceptor.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/tx/BMTInterceptor.java	2007-06-19 13:17:05 UTC (rev 63571)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/tx/BMTInterceptor.java	2007-06-19 17:12:30 UTC (rev 63572)
@@ -170,7 +170,7 @@
          // fall through...
          case Status.STATUS_PREPARED :
             String msg = "Application error: BMT stateless bean " + container.getEjbName()
-                         + " should complete transactions before" + " returning (ejb1.1 spec, 11.6.1)";
+                         + " should complete transactions before" + " returning (EJB3 13.6.1)";
             log.error(msg);
 
             // the instance interceptor will discard the instance

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java	2007-06-19 13:17:05 UTC (rev 63571)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java	2007-06-19 17:12:30 UTC (rev 63572)
@@ -32,6 +32,7 @@
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
 
+import org.jboss.logging.Logger;
 import org.jboss.tm.TransactionManagerLocator;
 
 /**
@@ -45,6 +46,8 @@
 @TransactionManagement(TransactionManagementType.BEAN)
 public class BMTCleanUpBean implements BMTCleanUp
 {
+   private static final Logger log = Logger.getLogger(BMTCleanUpBean.class);
+   
    @Resource
    private SessionContext sessionCtx;
    
@@ -98,6 +101,7 @@
          ut.setTransactionTimeout(5);
          ut.begin();
          Thread.sleep(10000);
+         log.info("tx status: " + ut.getStatus());
       }
       catch (InterruptedException ignored)
       {
@@ -114,11 +118,12 @@
       try
       {
          remote.doIncomplete();
+         throw new RuntimeException("Expected an EJBException for incomplete transaction");
       }
       catch (EJBException expected)
       {
          // expected
-         expected.printStackTrace();
+         log.debug("Expected exception", expected);
       }
       checkTransaction();
       remote.doNormal();
@@ -127,15 +132,7 @@
    public void testTxTimeout()
    {
       BMTCleanUp remote = (BMTCleanUp) sessionCtx.getEJBObject();
-      try
-      {
-         remote.doTimeout();
-      }
-      catch (EJBException expected)
-      {
-         // expected
-         expected.printStackTrace();
-      }
+      remote.doTimeout();
       checkTransaction();
       remote.doNormal();
    }




More information about the jboss-cvs-commits mailing list