Package org.jboss.ejb3.core.test.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


   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

   }
  
   @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

  
   // 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

   {
      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

   {
      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

   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

      //DeploymentScope scope = null;
      if (unit.getParent() != null)
      {
         boolean isEar = unit != unit.getTopLevel();
         this.deploymentScope = new JBoss5DeploymentScope(unit.getParent(), isEar);
      }

      ejbResolver = new ClientEjbResolver(deploymentScope, unit.getSimpleName());
      messageDestinationResolver = new MessageDestinationResolver(deploymentScope, xml.getMessageDestinations());
View Full Code Here

         throw new NullPointerException("applicationClientName is mandatory");
      if (classLoader == null)
         throw new NullPointerException("classLoader is mandatory");

      this.deploymentUnit = unit;
      this.ejb3Unit = new JBoss5DeploymentUnit(unit);
      this.clientMetaData = xml;
      this.mainClass = mainClass;
      this.applicationClientName = applicationClientName;
      this.classLoader = classLoader;
View Full Code Here

    * @param shortName
    */
   public JBoss5DeploymentScope(VFSDeploymentUnit parent, boolean isEar, String shortName)
   {
      this(parent, isEar);
      ejbRefResolver = new EjbModuleEjbResolver(this, shortName);
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.core.test.txsync.TxSync

Copyright © 2018 www.massapicom. 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.