Examples of TxSync


Examples of org.jboss.ejb3.core.test.txsync.TxSync

   public void testAfterCompletionCommit() throws Exception
   {
      tm.begin();
      try
      {
         TxSync bean = lookup("TxSyncBean/local", TxSync.class);
         bean.setThrowInAfterCompletion(true);
         bean.sayHi("me");
      }
      finally
      {
         tm.commit();
      }
View Full Code Here

Examples of org.jboss.ejb3.core.test.txsync.TxSync

   public void testBeforeCompletion() throws Exception
   {
      tm.begin();
      try
      {
         TxSync bean = lookup("TxSyncBean/local", TxSync.class);
         bean.setThrowInBeforeCompletion(true);
         bean.sayHi("me");
      }
      finally
      {
         tm.commit();
      }
View Full Code Here

Examples of org.jboss.ejb3.core.test.txsync.TxSync

   }
  
   @Test
   public void testRemove() throws Exception
   {
      TxSync bean;
      tm.begin();
      try
      {
         bean = lookup("TxSyncBean/local", TxSync.class);
         bean.remove();
      }
      finally
      {
         tm.commit();
      }
      tm.begin();
      try
      {
         try
         {
            bean.sayHi("me");
            fail("Should have throw NoSuchEJBException");
         }
         catch(NoSuchEJBException e)
         {
            // good
View Full Code Here

Examples of org.jboss.ejb3.core.test.txsync.TxSync

  
   // Don't test this yet, because it's another issue
   //@Test
   public void testReverseSyncRemove() throws Exception
   {
      TxSync bean;
      tm.begin();
      tm.getControlledTransaction().setReverseSyncRegistration(true);
      try
      {
         bean = lookup("TxSyncBean/local", TxSync.class);
         bean.remove();
      }
      finally
      {
         tm.commit();
      }
      tm.begin();
      try
      {
         try
         {
            bean.sayHi("me");
            fail("Should have throw NoSuchEJBException");
         }
         catch(NoSuchEJBException e)
         {
            // good
View Full Code Here

Examples of org.jboss.ejb3.core.test.txsync.TxSync

   {
      tm.begin();
      try
      {
         TxSyncBean.setThrowInAfterBegin(true);
         TxSync bean = lookup("TxSyncBean/local", TxSync.class);
         try
         {
            bean.sayHi("me");
            fail("Should have thrown EJBTransactionRolledbackException");
         }
         catch(EJBTransactionRolledbackException e)
         {
            assertEquals("afterBegin", e.getCause().getMessage());
View Full Code Here

Examples of org.jboss.ejb3.core.test.txsync.TxSync

   {
      tm.begin();
      try
      {
         TxSyncBean.setThrowInAfterBegin(true);
         TxSync bean = lookup("TxSyncBean/local", TxSync.class);
         try
         {
            bean.sayHi("me");
            fail("Should have thrown EJBTransactionRolledbackException");
         }
         catch(EJBTransactionRolledbackException e)
         {
            assertEquals("afterBegin", e.getCause().getMessage());
View Full Code Here

Examples of org.jboss.ejb3.core.test.txsync.TxSync

   public void testAfterCompletion() throws Exception
   {
      tm.begin();
      try
      {
         TxSync bean = lookup("TxSyncBean/local", TxSync.class);
         bean.setThrowInAfterCompletion(true);
         bean.sayHi("me");
      }
      finally
      {
         tm.rollback();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.