Package org.jboss.test.cluster.ejb3.clusteredsession.ejbthree921

Examples of org.jboss.test.cluster.ejb3.clusteredsession.ejbthree921.MyStateful


   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.setState("state");
      String state = stateful.getState();
      assertEquals("state", state);
   }
View Full Code Here


      client.login();
     
      StatefulHome home = (StatefulHome)getInitialContext().lookup("StatefulBean/home");
      assertNotNull(home);
      ExtendedState state = new ExtendedState("init");
      Stateful stateful = home.create(state);
      assertNotNull(stateful);
      String s = stateful.getState();
      assertEquals("Extended_init", s);
   }
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
     
      try
      {
         stateful.testThrownException();
         fail("no exception caught");
      }
      catch (Exception e)
      {
         StackTraceElement[] stackTrace = e.getStackTrace();
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
     
      try
      {
         stateful.testExceptionCause();
         fail("no exception caught");
      }
      catch (Exception e)
      {
         Throwable cause = e.getCause();
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      assertFalse(stateful.interceptorAccessed());
      assertTrue(RemoteBindingInterceptor.accessed);
   }
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.lookupStateful();
      Thread.sleep(10 * 1000);
      stateful.testStateful();
     
      stateful.lookupStateful();
      stateful.testStateful();
      Thread.sleep(10 * 1000);
      stateful.testStateful();
   }
View Full Code Here

      stateless.testInjection();
     
      ServiceRemote service = (ServiceRemote) getInitialContext().lookup("ServiceBean/remote");
      service.testInjection();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.setState("state");
      assertEquals("state", stateful.getState());
      stateful.testSerializedState("state");
      assertEquals(null, stateful.getInterceptorState());
      stateful.setInterceptorState("hello world");
      assertFalse(stateful.testSessionContext());
      Thread.sleep(10 * 1000);
      assertTrue(stateful.wasPassivated());
     
      assertEquals("state", stateful.getState());
      assertEquals("hello world", stateful.getInterceptorState());

      Stateful another = (Stateful)getInitialContext().lookup("Stateful");
      assertEquals(null, another.getInterceptorState());
      another.setInterceptorState("foo");
      assertEquals("foo", another.getInterceptorState());
      assertEquals("hello world", stateful.getInterceptorState());
     
      assertFalse(stateful.testSessionContext());
     
      stateful.testResources();
View Full Code Here

      assertTrue(stateful.wasPassivated());
     
      assertEquals("state", stateful.getState());
      assertEquals("hello world", stateful.getInterceptorState());

      Stateful another = (Stateful)getInitialContext().lookup("Stateful");
      assertEquals(null, another.getInterceptorState());
      another.setInterceptorState("foo");
      assertEquals("foo", another.getInterceptorState());
      assertEquals("hello world", stateful.getInterceptorState());
     
      assertFalse(stateful.testSessionContext());
     
      stateful.testResources();
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
     
      int startingRemoveCount = stateful.beansRemoved();
     
      stateful.removeMe();
      try
      {
         stateful.getState();
         fail("Bean should have been removed");
      } catch (NoSuchEJBException e)
      {
        
      }
     
      stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.setState("InMyTimeOfDying");
     
      stateful.removeMe();
      try
      {
         stateful.getState();
         fail("Bean should have been removed");
      } catch (NoSuchEJBException e)
      {
        
      }
     
      StatefulHome home = (StatefulHome)getInitialContext().lookup("StatefulBean/home");
      assertNotNull(home);
      Stateful21 stateful21 = (Stateful21)home.create();
      assertNotNull(stateful21);
      stateful21.removeMe();
     
      try
      {
         stateful.getState();
         fail("Bean should have been removed");
      } catch (NoSuchEJBException e)
      {
        
      }
     
      stateful = (Stateful)getInitialContext().lookup("Stateful");
      int beansRemoved = stateful.beansRemoved();
      assertEquals(3, beansRemoved - startingRemoveCount);
   }
View Full Code Here

        
      }
     
      StatefulHome home = (StatefulHome)getInitialContext().lookup("StatefulBean/home");
      assertNotNull(home);
      Stateful21 stateful21 = (Stateful21)home.create();
      assertNotNull(stateful21);
      stateful21.removeMe();
     
      try
      {
         stateful.getState();
         fail("Bean should have been removed");
View Full Code Here

TOP

Related Classes of org.jboss.test.cluster.ejb3.clusteredsession.ejbthree921.MyStateful

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.