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

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


      SessionTestUtil.invokeRequest(managers[0], modifyHandler, setHandler.getSessionId());
     
      Thread.sleep(1760);
     
      // Fail over and confirm all is well
      BasicRequestHandler getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(managers[1], getHandler, setHandler.getSessionId());
     
      validateExpectedAttributes(allAttributes, getHandler);
     
   }
View Full Code Here


      setHandler = new SetAttributesRequestHandler(allAttributes, false);
      SessionTestUtil.invokeRequest(managersB[0], setHandler, null);
      validateNewSession(setHandler);
      String idB = setHandler.getSessionId();
     
      BasicRequestHandler getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(managersA[1], getHandler, idA);
     
      validateExpectedAttributes(allAttributes, getHandler);
     
      getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(managersB[1], getHandler, idB);
     
      validateExpectedAttributes(allAttributes, getHandler);
     
      // Undeploy one webapp on node 1
      managersB[1].stop();
      log.info("jbcmB1 stopped");

      // Deploy again
      managersB[1] = this.startManager(warnameB, cacheContainers[1]);

      log.info("jbcmB1 started");
     
//      log.info(dcmFactories[0].getCache().getMembers());
//      log.info(dcmFactories[1].getCache().getMembers());
     
      getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(managersA[1], getHandler, idA);
     
      validateExpectedAttributes(allAttributes, getHandler);
     
      getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(managersB[1], getHandler, idB);
     
      validateExpectedAttributes(allAttributes, getHandler);
   }
View Full Code Here

      assertEquals(0, Attribute.attributeCount());
      assertNull(session0B.get());
      assertNull(session1A.get());
     
      // Reactivate
      BasicRequestHandler getHandler = new BasicRequestHandler(KEYS, false);
      log.info("activate node 1");
      SessionTestUtil.invokeRequest(jbcm1, getHandler, sessionId);
     
      WeakReference<Session> session1B = new WeakReference<Session>(jbcm1.findSession(sessionId));
      SessionTestUtil.cleanupPipeline(jbcm1);
      assertNotNull(session1B.get());
      assertEquals(1, Attribute.attributeCount());     
     
      // Fail back
      getHandler = new BasicRequestHandler(KEYS, false);
      log.info("fail back request");
      SessionTestUtil.invokeRequest(jbcm0, getHandler, sessionId);
     
      WeakReference<Session> session0C = new WeakReference<Session>(jbcm0.findSession(sessionId));
      SessionTestUtil.cleanupPipeline(jbcm0);
View Full Code Here

      validateNewSession(setHandler);
     
      Thread.sleep(250);
     
      // Now make a request that will not trigger replication but keeps the jbcm0 session alive
      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 it doesn't have a maxUnreplicatedInterval grace period
      Thread.sleep(2800);
     
      // jbcm1 considers the session unmodified for > 3 sec maxInactiveInterval.
      // Try to drive the session out of the jbcm1 cache     
      jbcm1.backgroundProcess();
     
      // Replicate just one attribute; see if the other is still in jbcm1
      SetAttributesRequestHandler modifyHandler = new SetAttributesRequestHandler(mutables, false);
      SessionTestUtil.invokeRequest(jbcm0, modifyHandler, setHandler.getSessionId());
     
      // Fail over and confirm all is well. If the session was removed,
      // the last replication of just one attribute won't restore all
      // attributes and we'll have a failure
      getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
     
      validateExpectedAttributes(allAttributes, getHandler);
   }
View Full Code Here

      SessionTestUtil.invokeRequest(jbcm0, modifyHandler, setHandler.getSessionId());
     
      Thread.sleep(1760);
     
      // Fail over and confirm all is well
      BasicRequestHandler getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
     
      validateExpectedAttributes(allAttributes, getHandler);
     
   }
View Full Code Here

      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

     
      // 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

      // FIXME -- avoid direct cache operations
      assertNotNull(pojoCaches[1].getCache().get(session1Fqn, CacheHelper.VERSION_KEY));
      assertNotNull(pojoCaches[1].getCache().get(session2Fqn, CacheHelper.VERSION_KEY));
     
      // Access one to prove it gets expired once the manager can see its real timestamp
      BasicRequestHandler getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
      SessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler1.getSessionId());     
      validateNewSession(getHandler);
     
      // Sleep past the grace period
      Thread.sleep(2010);
View Full Code Here

TOP

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

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.