Examples of MyStatefulLocalBusiness


Examples of org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb.MyStatefulLocalBusiness

      Assert.assertNotNull("Lookup of local bean at " + localJndiName + " returned null", obj);
      Assert.assertTrue("Lookup at " + localJndiName + " returned unexpected object " + obj,
            obj instanceof MyStatefulLocalBusiness);

      MyStatefulLocalBusiness bean = (MyStatefulLocalBusiness) obj;
      int counter = bean.getNextCounter();
      logger.debug("Got counter " + counter);

      Assert.assertEquals("Unexpected counter value = " + counter, counter, 0);

   }
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb.MyStatefulLocalBusiness

    */
   @Test
   public void testSessionScoping() throws Exception
   {
      // Lookup 2 Instances
      MyStatefulLocalBusiness bean1 = (MyStatefulLocalBusiness) ProxyStatefulSessionTestCase.context
            .lookup("MyStatefulBean/local");
      MyStatefulLocalBusiness bean2 = (MyStatefulLocalBusiness) ProxyStatefulSessionTestCase.context
            .lookup("MyStatefulBean/local");

      // Invoke continuously on instance one 10 times to ensure that the SFSB counter increments properly
      for (int counter = 0; counter < 10; counter++)
      {
         // Invoke
         int result = bean1.getNextCounter();
         TestCase.assertEquals("SFSB invocations should have memory of the session", counter, result);
      }

      // Invoke once on instance two to ensure its scope is separate from that of instance one
      TestCase
            .assertEquals("SFSB Session Scopes must not be shared between Proxy instances", 0, bean2.getNextCounter());
   }
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb.MyStatefulLocalBusiness

    */
   @Test
   public void testSessionScoping() throws Exception
   {
      // Lookup 2 Instances
      MyStatefulLocalBusiness bean1 = (MyStatefulLocalBusiness) ProxyStatefulSession30OnlyTestCase.context
            .lookup("MyStateful30OnlyBean/local");
      MyStatefulLocalBusiness bean2 = (MyStatefulLocalBusiness) ProxyStatefulSession30OnlyTestCase.context
            .lookup("MyStateful30OnlyBean/local");

      // Invoke continuously on instance one 10 times to ensure that the SFSB counter increments properly
      for (int counter = 0; counter < 10; counter++)
      {
         // Invoke
         int result = bean1.getNextCounter();
         TestCase.assertEquals("SFSB invocations should have memory of the session", counter, result);
      }

      // Invoke once on instance two to ensure its scope is separate from that of instance one
      TestCase
            .assertEquals("SFSB Session Scopes must not be shared between Proxy instances", 0, bean2.getNextCounter());
   }
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb.MyStatefulLocalBusiness

      Assert.assertNotNull("Local jndi name " + localJNDIName + " lookup returned null", obj);
      Assert.assertTrue("Local jndi name lookup at " + localJNDIName + " returned unexpected object " + obj,
            obj instanceof MyStatefulLocalBusiness);

      MyStatefulLocalBusiness localBean = (MyStatefulLocalBusiness) obj;

      int count = localBean.getNextCounter();
      Assert.assertEquals("Unexpected counter value: " + count + " from local stateful bean", count, 0);

      // now lookup remote and invoke on it
      String remoteJNDIName = smd.getJndiName();
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.