// A war with a maxInactive of 30 mins maxUnreplicated of 0
this.startManagers(warname, 1800, 1);
// Initial request
SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(getAttributeMap(), false);
log.info("initial request");
SessionTestUtil.invokeRequest(managers[0], setHandler, null);
String sessionId = setHandler.getSessionId();
WeakReference<Session> session0A = new WeakReference<Session>(managers[0].findSession(sessionId));
SessionTestUtil.cleanupPipeline(managers[0]);
assertNotNull(session0A.get());
// Modify attribute request
setHandler = new SetAttributesRequestHandler(getAttributeMap(), false);
log.info("Modify attribute request");
SessionTestUtil.invokeRequest(managers[0], setHandler, sessionId);
SessionTestUtil.cleanupPipeline(managers[0]);
System.gc();
System.runFinalization();
assertEquals(1, Attribute.attributeCount());
// Passivate
Thread.sleep(1100);
log.info("passivate node 0");
managers[0].backgroundProcess();
log.info("passivate node 1");
managers[1].backgroundProcess();
System.gc();
System.runFinalization();
assertEquals(0, Attribute.attributeCount());
assertNull(session0A.get());
// Remove attribute request
RemoveAttributesRequestHandler removeHandler = new RemoveAttributesRequestHandler(KEYS, false);
log.info("remove request");
SessionTestUtil.invokeRequest(managers[0], removeHandler, sessionId);
WeakReference<Session> session0B = new WeakReference<Session>(managers[0].findSession(sessionId));
SessionTestUtil.cleanupPipeline(managers[0]);
System.gc();
System.runFinalization();
assertEquals(0, Attribute.attributeCount());
assertNotNull(session0B.get());
// Failover request
setHandler = new SetAttributesRequestHandler(getAttributeMap(), false);
log.info("failover request");
SessionTestUtil.invokeRequest(managers[1], setHandler, sessionId);
WeakReference<Session> session1A = new WeakReference<Session>(managers[1].findSession(sessionId));
SessionTestUtil.cleanupPipeline(managers[1]);