Package org.jboss.test.cluster.web.mocks

Examples of org.jboss.test.cluster.web.mocks.SetAttributesRequestHandler


      JBossCacheManager[] mgrs = getCacheManagers(warname, 3, maxUnrep);
      JBossCacheManager jbcm0 = mgrs[0];
      JBossCacheManager jbcm1 = mgrs[1];
     
      // Establish session.
      SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(allAttributes, false);
      SessionTestUtil.invokeRequest(jbcm0, setHandler, null);
     
      validateNewSession(setHandler);
     
      Thread.sleep(1050);
     
      // Now make a request that will not trigger replication unless the interval is exceeded
      BasicRequestHandler getHandler = new BasicRequestHandler(immutables.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm0, getHandler, setHandler.getSessionId());
     
      validateExpectedAttributes(immutables, getHandler);
     
      // Sleep long enough that the session will be expired on other server
      // if previous request didn't keep it alive
      Thread.sleep(2000);
     
      // Fail over and confirm all is well
      getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
     
      validateExpectedAttributes(allAttributes, getHandler);
   }
View Full Code Here


      // A war with a maxInactive of 3 secs and a maxUnreplicated of 1
      JBossCacheManager[] mgrs = getCacheManagers(warname, 3, 1);
      JBossCacheManager jbcm0 = mgrs[0];
      JBossCacheManager jbcm1 = mgrs[1];
     
      SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(allAttributes, false);
      SessionTestUtil.invokeRequest(jbcm0, setHandler, null);
     
      // Sleep less than the maxUnreplicated time so next request shouldn't trigger timestamp repl
      Thread.sleep(500);
     
      // Now make a request that will not trigger replication unless the interval is exceeded
      BasicRequestHandler getHandler = new BasicRequestHandler(immutables.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm0, getHandler, setHandler.getSessionId());
     
      validateExpectedAttributes(immutables, getHandler);
     
      // Sleep long enough that the session will be expired on other server
      // if previous request didn't keep it alive
      Thread.sleep(2600);
     
      // Fail over and confirm the session was expired
      getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
     
      validateNewSession(getHandler);
   }
View Full Code Here

     
      JBossCacheManager[] mgrs = getCacheManagers(warname, 3, 2);
      JBossCacheManager jbcm0 = mgrs[0];
      JBossCacheManager jbcm1 = mgrs[1];
     
      SetAttributesRequestHandler setHandler1 = new SetAttributesRequestHandler(allAttributes, false);
      SessionTestUtil.invokeRequest(jbcm0, setHandler1, null);
     
      Fqn session1Fqn = Fqn.fromString(SessionTestUtil.getSessionFqn(warname, setHandler1.getSessionId()));
     
      SetAttributesRequestHandler setHandler2 = new SetAttributesRequestHandler(allAttributes, false);
      SessionTestUtil.invokeRequest(jbcm0, setHandler2, null);
     
      Fqn session2Fqn = Fqn.fromString(SessionTestUtil.getSessionFqn(warname, setHandler2.getSessionId()));
     
      // Overage the sessions
      Thread.sleep(3010);
      // Try to force out the overaged sessions
      jbcm1.backgroundProcess();
View Full Code Here

TOP

Related Classes of org.jboss.test.cluster.web.mocks.SetAttributesRequestHandler

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.