Package org.jboss.test.cts.interfaces

Examples of org.jboss.test.cts.interfaces.StatelessSession


   static void testEjbs() throws Exception
   {
      log.info("+++ testEjbs");
      Context enc = getENC();     
      StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/StatelessSessionBean");
      StatelessSession session = home.create();
      session.method1("testEjbs");
      session.remove();
   }
View Full Code Here


   {
      getLog().debug("+++ testCreateExceptionFromInterface()");
      InitialContext ctx = new InitialContext();
      Object ref = ctx.lookup("ejbcts/StatelessSessionHome");
      StatelessSessionHome home = (StatelessSessionHome) PortableRemoteObject.narrow(ref, StatelessSessionHome.class);
      StatelessSession sessionBean = home.create();
      sessionBean.breakCreate();
      ObjectName pool = new ObjectName("jboss.j2ee:jndiName=ejbcts/StatelessSessionHome,plugin=pool,service=EJB");
      getServer().invoke(pool, "clear", null, null);
      try
      {
         sessionBean.method1("This should cause a CreateException");
         fail("Should not be here");
      }
      catch (RemoteException expected)
      {
         log.debug("Expected", expected);
View Full Code Here

   public void testPassivationByTimeLocal() throws Exception
   {
      Context ctx = new InitialContext();
      getLog().debug("+++ testPassivationByTimeLocal");
      StatelessSessionHome sessionHome = ( StatelessSessionHome ) ctx.lookup("ejbcts/StatelessSessionHome");
      StatelessSession session = sessionHome.create();
      session.testPassivationByTimeLocal();
      getLog().debug("--- testPassivationByTimeLocal");
   }
View Full Code Here

    */
   public void testEjbs() throws Exception
   {
      Context enc = getENC();     
      StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/StatelessSessionBean");
      StatelessSession session = home.create();
      session.method1("testEjbs");
      session.remove();
   }
View Full Code Here

      getLog().debug("Unserialize bean handle...");
      ByteArrayInputStream in = new ByteArrayInputStream(bytes);
      ObjectInputStream ois = new ObjectInputStream(in);
      beanHandle = (Handle) ois.readObject();
      StatelessSession theSession = (StatelessSession) beanHandle.getEJBObject();
      theSession.method1("Hello");
      getLog().debug("Called method1 on handle session bean");
   }
View Full Code Here

      {
         getLog().debug("Unserialize bean handle...");
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         ObjectInputStream ois = new ObjectInputStream(in);
         beanHandle = (Handle) ois.readObject();
         StatelessSession theSession = (StatelessSession) beanHandle.getEJBObject();
         theSession.method1("Hello");
         getLog().debug("Called method1 on handle session bean");
      }
      finally
      {
         System.setProperties(sysProps);
View Full Code Here

         Object ref = ctx.lookup("ejbcts/StatelessSessionHome");
         StatelessSessionHome home = (StatelessSessionHome)
               PortableRemoteObject.narrow(ref, StatelessSessionHome.class);
         sessionBean = home.create();
         StatelessSessionHome home2 = (StatelessSessionHome) sessionBean.getEJBHome();
         StatelessSession bean2 = home2.create();
         bean2.remove();
      }
      finally
      {
         System.setProperties(sysProps);
      }
View Full Code Here

   public void testPassivationByTimeLocal() throws Exception
   {
      Context ctx = new InitialContext();
      getLog().debug("+++ testPassivationByTimeLocal");
      StatelessSessionHome sessionHome = ( StatelessSessionHome ) ctx.lookup("ejbcts/StatelessSessionHome");
      StatelessSession session = sessionHome.create();
      session.testPassivationByTimeLocal();
      getLog().debug("--- testPassivationByTimeLocal");
   }
View Full Code Here

   {
      getLog().debug("+++ testCreateExceptionFromInterface()");
      InitialContext ctx = new InitialContext();
      Object ref = ctx.lookup("ejbcts/StatelessSessionHome");
      StatelessSessionHome home = (StatelessSessionHome) PortableRemoteObject.narrow(ref, StatelessSessionHome.class);
      StatelessSession sessionBean = home.create();
      sessionBean.breakCreate();
      ObjectName pool = new ObjectName("jboss.j2ee:jndiName=ejbcts/StatelessSessionHome,plugin=pool,service=EJB");
      getServer().invoke(pool, "clear", null, null);
      try
      {
         sessionBean.method1("This should cause a CreateException");
         fail("Should not be here");
      }
      catch (RemoteException expected)
      {
         log.debug("Expected", expected);
View Full Code Here

      getLog().debug("Unserialize bean handle...");
      ByteArrayInputStream in = new ByteArrayInputStream(bytes);
      ObjectInputStream ois = new ObjectInputStream(in);
      beanHandle = (Handle) ois.readObject();
      StatelessSession theSession = (StatelessSession) beanHandle.getEJBObject();
      theSession.method1("Hello");
      getLog().debug("Called method1 on handle session bean");
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.cts.interfaces.StatelessSession

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.