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();
     
      StatefulHome home = (StatefulHome)getInitialContext().lookup("StatefulBean/home");
      assertNotNull(home);
      javax.ejb.EJBObject stateful = (javax.ejb.EJBObject)home.create();
      assertNotNull(stateful);
   }
View Full Code Here


   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      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

      } catch (NoSuchEJBException e)
      {
        
      }
     
      StatefulHome home = (StatefulHome)getInitialContext().lookup("StatefulBean/home");
      assertNotNull(home);
      Stateful21 stateful21 = (Stateful21)home.create();
      assertNotNull(stateful21);
      stateful21.removeMe();
     
      try
      {
View Full Code Here

      stateful.getState();
     
      StatefulInvoker[] invokers = new StatefulInvoker[2];
      for (int i = 0; i < 2 ; ++i)
      {
         invokers[i] = new StatefulInvoker(stateful);
      }
     
      for (StatefulInvoker invoker: invokers)
      {
         invoker.start();
      }
     
      Thread.sleep(10000);
     
      for (StatefulInvoker invoker: invokers)
      {
         if (invoker.getException() != null)
            throw invoker.getException();
      }
     
      stateful = (ConcurrentStateful) new InitialContext().lookup("Stateful");
     
      invokers = new StatefulInvoker[2];
      for (int i = 0; i < 2 ; ++i)
      {
         invokers[i] = new StatefulInvoker(stateful);
      }
     
      for (StatefulInvoker invoker: invokers)
      {
         invoker.start();
View Full Code Here

      stateful.getState();
     
      StatefulInvoker[] invokers = new StatefulInvoker[2];
      for (int i = 0; i < 2 ; ++i)
      {
         invokers[i] = new StatefulInvoker(stateful);
      }
     
      for (StatefulInvoker invoker: invokers)
      {
         invoker.start();
View Full Code Here

      System.out.println("maxConnectionsInUseCount \n" + maxConnectionsInUseCount);
   }
  
   public void testTimeoutRemoval() throws Exception
   {
      StatefulTimeout sfsb = (StatefulTimeout)getInitialContext().lookup("StatefulTimeoutBean/remote");
      sfsb.test();
      Thread.sleep(5 * 1000);
     
      try
      {
         sfsb.test();
         fail("SFSB should have been removed via timeout");
      } catch (javax.ejb.NoSuchEJBException e)
      {
      }
     
      sfsb = (StatefulTimeout)getInitialContext().lookup("StatefulTimeoutBean2/remote");
      sfsb.test();
      Thread.sleep(10 * 1000);
     
      try
      {
         sfsb.test();
         fail("SFSB should have been removed via timeout");
      } catch (javax.ejb.NoSuchEJBException e)
      {
      }
   }
View Full Code Here

      }
   }
  
   public void testClusteredTimeoutRemoval() throws Exception
   {
      StatefulTimeout sfsb = (StatefulTimeout)getInitialContext().lookup("StatefulClusteredTimeoutBean/remote");
      sfsb.test();
      Thread.sleep(5 * 1000);
     
      try
      {
         sfsb.test();
         fail("SFSB should have been removed via timeout");
      } catch (javax.ejb.NoSuchEJBException e)
      {
      }
     
      sfsb = (StatefulTimeout)getInitialContext().lookup("StatefulClusteredTimeoutBean2/remote");
      sfsb.test();
      Thread.sleep(10 * 1000);
     
      try
      {
         sfsb.test();
         fail("SFSB should have been removed via timeout");
      } catch (javax.ejb.NoSuchEJBException e)
      {
      }
   }
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      StatefulTx stateful = (StatefulTx)getInitialContext().lookup("StatefulTxBean/remote");
      assertNotNull(stateful);
     
      boolean transacted = stateful.isLocalTransacted();
      assertTrue(transacted);
      transacted = stateful.isGlobalTransacted();
      assertFalse(transacted);
      transacted = stateful.testNewTx();
      assertTrue(transacted);
     
      try
      {
         stateful.testTxRollback();
         fail("should have caught exception");
      }
      catch (javax.ejb.EJBException e)
      {
      }
View Full Code Here

   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      StatefulTx stateful = (StatefulTx)getInitialContext().lookup("StatefulTxBean/remote");
      assertNotNull(stateful);
     
      try
      {
         stateful.testMandatoryTx(new State("test"));
         fail("should have caught exception");
      }
      catch (javax.ejb.EJBTransactionRequiredException e)
      {
      }
View Full Code Here

     
      // We want a colocated SLSB and SFSB to test passivation/destruction
      // VMIDTrackerBean is not clustered, so once we have it's VMID
      // we can keep creating SFSBs until we get one we want
      getLog().debug("Looking up VMTrackerBean...");
      VMTracker tracker = (VMTracker) getInitialContext(0).lookup("VMTrackerBean/remote");
      VMID monitorVM = tracker.getVMID();
     
      NodeAnswer node0 = null;
      boolean vmMatch = false;
      for (int i = 0; i < 10 && !vmMatch; i++)
      {
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.