assertAttributeCount(0);
assertNullReference(session0B);
assertNullReference(session1A);
// Reactivate
BasicRequestHandler getHandler = new BasicRequestHandler(KEYS, false);
log.info("activate node 1");
SessionTestUtil.invokeRequest(mgr1, getHandler, sessionId);
WeakReference<Session> session1B = new WeakReference<Session>(mgr1.findSession(sessionId));
SessionTestUtil.cleanupPipeline(mgr1);
assertNotNull(session1B.get());
assertAttributeCount(1);
// Fail back
getHandler = new BasicRequestHandler(KEYS, false);
log.info("fail back request");
SessionTestUtil.invokeRequest(mgr0, getHandler, sessionId);
WeakReference<Session> session0C = new WeakReference<Session>(mgr0.findSession(sessionId));
SessionTestUtil.cleanupPipeline(mgr0);
assertNotNull(session0C.get());
assertAttributeCount(2);
// Invalidate session
InvalidateSessionRequestHandler invalidateHandler = new InvalidateSessionRequestHandler(KEYS, false);
log.info("invalidate request");
SessionTestUtil.invokeRequest(mgr0, invalidateHandler, sessionId);
SessionTestUtil.cleanupPipeline(mgr0);
cleanHeap();
assertNotNull(session1B.get());
assertNullReference(session0C);
assertAttributeCount(1);
// Make mgr1 aware of the invalidation
getHandler = new BasicRequestHandler(KEYS, false);
SessionTestUtil.invokeRequest(mgr1, getHandler, sessionId);
cleanHeap();
assertNullReference(session1B);
assertAttributeCount(0);