Package org.jboss.test.cts.interfaces

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


      getLog().debug("+++ testSessionHandleNoDefaultJNDI()");

      Properties env = new Properties();
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
      InitialContext ctx = new InitialContext(env);
      StatefulSessionHome home = ( StatefulSessionHome ) ctx.lookup("ejbcts/StatefulSessionBean");
      StatefulSession bean = home.create("testSessionHandleNoDefaultJNDI");

      Handle beanHandle = bean.getHandle();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(beanHandle);
View Full Code Here


      getLog().debug("+++ testBMTSessionHandleNoDefaultJNDI()");

      Properties env = new Properties();
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
      InitialContext ctx = new InitialContext(env);
      StatefulSessionHome home = ( StatefulSessionHome ) ctx.lookup("ejbcts/BMTStatefulSessionBean");
      StatefulSession bean = home.create("testBMTSessionHandleNoDefaultJNDI");

      Handle beanHandle = bean.getHandle();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(beanHandle);
View Full Code Here

      env.setProperty("java.naming.provider.url", super.getJndiURL());
      try
      {
         InitialContext ctx = new InitialContext(env);
         Object ref = ctx.lookup("ejbcts/StatefulSessionBean");
         StatefulSessionHome home = (StatefulSessionHome)
               PortableRemoteObject.narrow(ref, StatefulSessionHome.class);
         StatefulSession bean1 = home.create("testHomeFromRemoteNoDefaultJNDI");
         StatefulSessionHome home2 = (StatefulSessionHome) bean1.getEJBHome();
         StatefulSession bean2 = home2.create("testHomeFromRemoteNoDefaultJNDI");
         bean2.remove();
      }
      finally
      {
         System.setProperties(sysProps);
View Full Code Here

   public void testProbeBeanContext ()
      throws Exception
   {
      getLog().debug("+++ testProbeBeanContext");
      Context ctx  = new InitialContext();
      StatefulSessionHome home = ( StatefulSessionHome ) ctx.lookup("ejbcts/StatefulSessionBean");
      StatefulSession bean = home.create("testProbeBeanContext");   

      getLog().debug("Invoking bean...");

      BeanContextInfo beanCtxInfo = bean.getBeanContextInfo();
View Full Code Here

   {
      getLog().debug("+++ testLoopback");

      // Create a new session object
      Context ctx  = new InitialContext();
      StatefulSessionHome home = ( StatefulSessionHome ) ctx.lookup("ejbcts/StatefulSessionBean");
      StatefulSession bean = home.create("testLoopback");   
      getLog().debug("Calling loopbackTest( )....");
      try
      {
         bean.loopbackTest();
         fail("Was able to call loopbackTest()");
View Full Code Here

      getLog().debug("Obtain home interface");
      // Create a new session object
      Context ctx  = new InitialContext();
      Object ref = ctx.lookup("ejbcts/StatefulSessionBean");
      StatefulSessionHome home = ( StatefulSessionHome ) PortableRemoteObject.narrow(ref,
         StatefulSessionHome.class);
      StatefulSession bean = home.create("testUserTx");   

      bean.setCounter(100);
      getLog().debug("Try to instantiate a UserTransaction");
      UserTransaction userTx = (UserTransaction)ctx.lookup("UserTransaction");
      userTx.begin();
View Full Code Here

      getLog().debug("Obtain home interface");
      // Create a new session object
      Context ctx  = new InitialContext();
      Object ref = ctx.lookup("ejbcts/BMTStatefulSessionBean");
      StatefulSessionHome home = (StatefulSessionHome) PortableRemoteObject.narrow(ref,
         StatefulSessionHome.class);
      StatefulSession bean = home.create("testBadUserTx");    

      MBeanServerConnection server = getServer();
      Long before = (Long) server.getAttribute(OBJECT_NAME, "TransactionCount");
      try
      {
View Full Code Here

      throws RemoteException
   {
      try
      {
        Context ctx = new InitialContext();
        StatefulSessionHome home = (StatefulSessionHome) ctx.lookup("ejbcts/StatefulSessionBean");
        StatefulSession sessionBean;
        try
        {
           sessionBean = home.create(testName);
        }
        catch (CreateException crex)
        {
           log.debug("Loopback CreateException: " + crex);
           throw new EJBException(crex);
View Full Code Here

   public void createStatefulSessionHandle(String testName)
   {
      log.info("createStatefulSessionHandle");
      try
      {
         StatefulSessionHome home = (StatefulSessionHome) sessionCtx.getEJBHome();
         StatefulSession bean = home.create(testName);
         bean.incCounter();
         Handle handle = bean.getHandle();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(handle);
View Full Code Here

      throws java.rmi.RemoteException
   {
      try
      {
        Context ctx = new InitialContext();
        StatefulSessionHome home = (StatefulSessionHome) ctx.lookup("ejbcts/StatefulSessionBean");
        StatefulSession sessionBean;
        try
        {
           sessionBean = home.create(testName);
        }
        catch (CreateException crex)
        {
           log.debug("Loopback CreateException: " + crex);
           throw new EJBException(crex);
View Full Code Here

TOP

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

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.