Examples of StatelessSession


Examples of org.jboss.test.classloader.leak.ejb.interfaces.StatelessSession

  
   protected void makeEjbRequests() throws Exception
   {
      InitialContext ctx = new InitialContext();
      StatelessSessionHome slsbhome = (StatelessSessionHome) ctx.lookup("ClassloaderLeakStatelessSession");
      StatelessSession slsbbean = slsbhome.create();
      slsbbean.log("EJB");
      StatefulSessionHome sfsbhome = (StatefulSessionHome) ctx.lookup("ClassloaderLeakStatefulSession");
      StatefulSession sfsbbean = sfsbhome.create();
      sfsbbean.log("EJB");
   }
View Full Code Here

Examples of org.jboss.test.classloader.scoping.override.ejb.log4j113.StatelessSession

      try
      {
         deploy("log4j113-ejb.jar");
         InitialContext ctx = new InitialContext();
         StatelessSessionHome home = (StatelessSessionHome) ctx.lookup("Log4j113StatelessBean");
         StatelessSession bean = home.create();
         Throwable error = bean.checkVersion();
         getLog().debug("StatelessSession.checkVersion returned:", error);
         assertTrue("checkVersion returned null", error == null);
      }
      catch(Exception e)
      {
View Full Code Here

Examples of org.jboss.test.cluster.ejb2.basic.interfaces.StatelessSession

      getLog().debug(++test+"- "+"Looking up the home nextgen.StatelessSession...");
      StatelessSessionHome  statelessSessionHome =
      (StatelessSessionHome) ctx.lookup("nextgen.StatelessSession");
      if (statelessSessionHome!= null ) getLog().debug("ok");
      getLog().debug(++test+"- "+"Calling create on StatelessSessionHome...");
      StatelessSession statelessSession =
      (StatelessSession)statelessSessionHome.create();
      assertTrue("statelessSessionHome.create() != null", statelessSession != null);
      getLog().debug("ok");
     
      getLog().debug(++test+"- "+"Calling getEJBHome() on StatelessSession...");
      assertTrue("statelessSession.getEJBHome() != null", statelessSession.getEJBHome() != null);
      getLog().debug("ok");
     
      getLog().debug(++test+"- "+"Reseting the number of calls made on beans (making 2 calls)... ");
      for (int i=0; i<6; i++)
      {
         getLog().debug(++test+"- "+" Reseting number... ");
         statelessSession.resetNumberOfCalls ();        
      }
     
      getLog().debug(++test+"- "+"Now making 20 calls on this remote... ");
      for (int i=0; i<20; i++)
      {
         getLog().debug(++test+"- "+" Calling remote... ");
         statelessSession.makeCountedCall ();        
      }
     
      getLog().debug(++test+"- "+"Getting the number of calls that have been performed on each bean... ");
      long node1 = statelessSession.getCallCount();
      getLog().debug(++test+"- "+"One node has received: " + node1);
     
      long node2 = statelessSession.getCallCount();
      getLog().debug(++test+"- "+"The other node has received: " + node2);
     
      if (node1 == node2 &&
          node1 == 10)
      {
         getLog().debug(++test+"- "+"Test is ok.");
      }
      else
      {
         getLog().debug(++test+"- "+"Something wrong has happened! Calls seems not to have been load-balanced.");
         fail ("Calls have not been correctly load-balanced on the SLSB remote interface.");
      }
     
      statelessSession.remove();
      getLog().debug("ok");
   }           
View Full Code Here

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

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

   {
      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

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

   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

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

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

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

      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

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

      {
         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

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

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