Package org.jboss.test.testbean.interfaces

Examples of org.jboss.test.testbean.interfaces.StatelessSessionHome


         Context ctx = new InitialContext();
        
         StatefulSessionHome sfHome = (StatefulSessionHome)ctx.lookup("java:comp/env/ejb/stateful");
         statefulSession = sfHome.create();
        
         StatelessSessionHome slHome = (StatelessSessionHome)ctx.lookup("java:comp/env/ejb/stateless");
         statelessSession = slHome.create();
        
         EnterpriseEntityHome eeHome = (EnterpriseEntityHome)ctx.lookup("java:comp/env/ejb/entity");
         try {
            enterpriseEntity = eeHome.findByPrimaryKey(aString);
         } catch (FinderException e) {
View Full Code Here


            p.put(Context.PROVIDER_URL, "10.10.10.13:1100,10.10.10.14:1100");
            // p.put(Context.PROVIDER_URL, "localhost:1100");
            p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
            InitialContext ctx = new InitialContext(p);
           
            StatelessSessionHome  statelessSessionHome =  (StatelessSessionHome) ctx.lookup("nextgen.StatelessSession");
            EnterpriseEntityHome  cmpHome =  (EnterpriseEntityHome)ctx.lookup("nextgen.EnterpriseEntity");
            StatelessSession statelessSession = statelessSessionHome.create();
            EnterpriseEntity cmp = null;
            try
            {
               cmp = cmpHome.findByPrimaryKey("bill");
            }
View Full Code Here

      getLog().debug("");
      getLog().debug("Test Stateless Bean load-balancing");
      getLog().debug("==================================");
      getLog().debug("");
      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);
View Full Code Here

            Context namingContext = new InitialContext();

            log.debug("EntityBMP Looking up Stateless Home");

            StatelessSessionHome statelessHome = ((StatelessSessionHome) namingContext.lookup("java:comp/env/ejb/myEJBRef"));

            log.debug("EntityBMP Calling create on Stateless Home");
           
            statelessSession = statelessHome.create();

            log.debug("EntityBMP Found the EJB Reference in my java:comp/env/ environment");


        }
View Full Code Here

      getLog().debug("");
      getLog().debug("Test Stateless Bean");
      getLog().debug("===================");
      getLog().debug("");
      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 =
      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+"- "+"Calling Business Method A on StatelessSession... ");
      statelessSession.callBusinessMethodA();
      getLog().debug("ok");
      getLog().debug(++test+"- "+"Calling Business Method B on StatelessSession... ");
      getLog().debug(statelessSession.callBusinessMethodB());
      getLog().debug(++test+"- "+"Calling Business Method B(String) on StatelessSession... ");
      getLog().debug(statelessSession.callBusinessMethodB("of wisdom"));
      getLog().debug(++test+"- "+"Calling Business Method C on StatelessSession... ");
      getLog().debug(statelessSession.callBusinessMethodC());
      getLog().debug(++test+"- "+"Calling Business Method D on StatelessSession... ");
      try
      {
         statelessSession.callBusinessMethodD();
         fail("callBusinessMethodD, no exception was thrown");
      }
      catch (BusinessMethodException e)
      {
         getLog().debug("Caught BusinessMethodException OK");
      }
      getLog().debug(++test+"- "+"Calling Business Method E (getEJBObject) on StatelessSession... ");
      getLog().debug(statelessSession.callBusinessMethodE());

      getLog().debug(++test+"- "+"Calling testClassLoading on StatelessSession... ");
      statelessSession.testClassLoading();
      getLog().debug("OK");

      getLog().debug("***Testing the various local Object class calls");
      getLog().debug(++test+"- "+"toString ... " + statelessSession.toString());

      getLog().debug(++test+"- "+"hashCode ... " + statelessSession.hashCode());

      getLog().debug(++test+"- "+"equals (same object) ... " + statelessSession.equals(statelessSession));

      getLog().debug(++test+"- "+"equals (another object) (true under same home)... " + statelessSession.equals(statelessSessionHome.create()));

      getLog().debug("***Testing the various local EJBObject class calls");

      getLog().debug(++test+"- "+"Get Handle ... ");
      Handle statelessHandle = statelessSession.getHandle();
      assertTrue("statelessHandle != null", statelessHandle != null);
      getLog().debug("OK");
      getLog().debug(++test+"- "+"Serialize handle and deserialize..");
      MarshalledObject mo = new MarshalledObject(statelessHandle);
      Handle handle2 = (Handle) mo.get();
      StatelessSession statelessSession2 = (StatelessSession) handle2.getEJBObject();
      assertTrue("statelessSession2 != null", statelessSession2 != null);
      getLog().debug("OK");
      getLog().debug(++test+"- "+"Calling businessMethodB on it...");
      getLog().debug(statelessSession2.callBusinessMethodB());
      getLog().debug(++test+"- "+"They should be identical..."+statelessSession.isIdentical(statelessSession2));
      getLog().debug("***Testing the various local EJBHome class calls");
      getLog().debug(++test+"- "+"Getting the metaData...");
      EJBMetaData statelessMetaData = statelessSessionHome.getEJBMetaData();
      assertTrue("statelessMetaData != null", statelessMetaData != null);
      getLog().debug("OK");
      getLog().debug(++test+"- "+"Is stateless Session? "+statelessMetaData.isStatelessSession());
      getLog().debug(++test+"- "+"The remote class is "+statelessMetaData.getRemoteInterfaceClass());

View Full Code Here

TOP

Related Classes of org.jboss.test.testbean.interfaces.StatelessSessionHome

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.