Package org.jboss.ejb3.core.test.ejbthree670.unit

Examples of org.jboss.ejb3.core.test.ejbthree670.unit.PreDestroyCallsTestCase


      containers.add(deploySessionEjb(MyStateful21Bean.class));
   }
  
   private MyStateful runMyStatefulTest() throws NamingException
   {
      MyStateful session = (MyStateful) getInitialContext().lookup("MyStatefulBean/remote");
      session.setName("Test");
      String actual = session.sayHello();
      assertEquals("Hi Test", actual);
      try
      {
         session.remove();
      }
      catch(RuntimeException e)
      {
         if(e.getCause().getMessage().equals("pre destroy called multiple times"))
            fail("pre destroy called multiple times");
View Full Code Here


   }
  
   @Test
   public void test1() throws Exception
   {
      MyStateful session = runMyStatefulTest();
      try
      {
         session.remove();
         fail("Should have thrown NoSuchEJBException");
      }
      catch(NoSuchEJBException e)
      {
         // okay
View Full Code Here

   }
  
   @Test
   public void testWithInTransaction() throws Exception
   {
      MyStateful session;
      TransactionManager tm = lookup("java:/TransactionManager", TransactionManager.class);
      tm.begin();
      try
      {
         session = runMyStatefulTest();
      }
      finally
      {
         tm.rollback();
      }
      try
      {
         session.remove();
         fail("Should have thrown NoSuchEJBException");
      }
      catch(NoSuchEJBException e)
      {
         // okay
View Full Code Here

  
   @Test
   public void test21() throws Exception
   {
      MyStateful21Home home = (MyStateful21Home) getInitialContext().lookup("MyStateful21Bean/home");
      MyStateful21 session = home.create();
      session.setName("Test");
      String actual = session.sayHello();
      assertEquals("Hi Test", actual);
      try
      {
         session.remove();
      }
      catch(RuntimeException e)
      {
         if(e.getCause().getMessage().equals("pre destroy called multiple times"))
            fail("pre destroy called multiple times");
View Full Code Here

  
   @Test
   public void testRemoveByHandle() throws Exception
   {
      MyStateful21Home home = (MyStateful21Home) getInitialContext().lookup("MyStateful21Bean/home");
      MyStateful21 session = home.create();
      session.setName("Test");
      String actual = session.sayHello();
      assertEquals("Hi Test", actual);
      try
      {
         home.remove(session.getHandle());
      }
      catch(RuntimeException e)
      {
         if(e.getCause().getMessage().equals("pre destroy called multiple times"))
            fail("pre destroy called multiple times");
View Full Code Here

   }
  
   @Test
   public void test21() throws Exception
   {
      MyStateful21Home home = (MyStateful21Home) getInitialContext().lookup("MyStateful21Bean/home");
      MyStateful21 session = home.create();
      session.setName("Test");
      String actual = session.sayHello();
      assertEquals("Hi Test", actual);
      try
      {
View Full Code Here

   }
  
   @Test
   public void testRemoveByHandle() throws Exception
   {
      MyStateful21Home home = (MyStateful21Home) getInitialContext().lookup("MyStateful21Bean/home");
      MyStateful21 session = home.create();
      session.setName("Test");
      String actual = session.sayHello();
      assertEquals("Hi Test", actual);
      try
      {
         home.remove(session.getHandle());
      }
      catch(RuntimeException e)
      {
         if(e.getCause().getMessage().equals("pre destroy called multiple times"))
            fail("pre destroy called multiple times");
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.ejbthree670.unit.PreDestroyCallsTestCase

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.