Examples of MyStateful


Examples of org.jboss.ejb3.test.iiop.MyStateful

   public void testRemoveByHandle() throws Exception
   {
      InitialContext ctx = getInitialContext();
      Object obj = ctx.lookup("MyStatefulBean/home");
      MyStatefulHome home = (MyStatefulHome) PortableRemoteObject.narrow(obj, MyStatefulHome.class);
      MyStateful session = home.create();
      session.setName("Me");
      home.remove(session.getHandle());
      try
      {
         session.sayHello();
         fail("should throw an exception");
      }
      catch(Exception e)
      {
         // TODO: check exception (NoSuchEJBException)
View Full Code Here

Examples of org.jboss.ejb3.test.iiop.MyStateful

  
   public void testService() throws Exception
   {
      InitialContext ctx = getInitialContext();
      Object obj = ctx.lookup("MyServiceBean/remote");
      MyStateful bean1 = (MyStateful) PortableRemoteObject.narrow(obj, MyStateful.class);
      bean1.setName("bean1");
      String response = bean1.sayHello();
      assertEquals("Hello bean1", response);
   }
View Full Code Here

Examples of org.jboss.ejb3.tx.test.metadata.MyStateful

      jarMetaData.setAssemblyDescriptor(assemblyDescriptor);
      jarMetaData.setEnterpriseBeans(enterpriseBeans);
     
      container = new StatefulContainer<MyStatefulBean>("Stateful Container", MyStatefulBean.class, enterpriseBean);
     
      MyStateful bean = container.constructProxy(MyStateful.class);
     
      tm.begin();
      try
      {
         bean.throwAppRuntimeException();
         fail("Should have thrown AppRuntimeException");
      }
      catch(AppRuntimeException e)
      {
         assertEquals("Transaction should have been marked for rollback", Status.STATUS_MARKED_ROLLBACK, tm.getStatus());
View Full Code Here

Examples of org.jboss.ejb3.tx.test.metadata.MyStateful

  
   private void testNPE(JBossSessionBeanMetaData enterpriseBean) throws Throwable
   {
      container = new StatefulContainer<MyStatefulBean>("Stateful Container", MyStatefulBean.class, enterpriseBean);
     
      MyStateful bean = container.constructProxy(MyStateful.class);
     
      tm.begin();
      try
      {
         bean.throwAppRuntimeException();
         fail("Should have thrown EJBTransactionRolledbackException");
      }
      catch(EJBTransactionRolledbackException e)
      {
         // good, it's not an application exception
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.clusteredsession.ejbthree921.MyStateful

      return new InitialContext(env1);
   }
  
   public void test1() throws Exception
   {
      MyStateful stateful = (MyStateful) getInitialContext(0).lookup("MyStatefulBean/remote");
      Person p = new Person("Brian");
      stateful.save(p);
      String expected = "Changing SFSB state";
      stateful.setDescription(expected);
      stateful.setUpFailover("once");
      try
      {
         String actual = stateful.getDescription();
         assertEquals(expected, actual);
      }
      catch(Exception e)
      {
         Throwable cause = e;
         while(cause.getCause() != null) cause = cause.getCause();
         throw (Exception) cause;
      }
      stateful.remove(p);
      stateful.done();
   }
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.