// A war with a maxInactive of 30 mins and no maxIdle
JBossCacheManager[] mgrs = getCacheManagers(warname, 1800000, -1, -1);
log.info("managers created");
log.info("creating session");
SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(Collections.singletonMap("count", getAttributeValue(0)), false);
invokeRequest(mgrs[0], setHandler, null);
String id = setHandler.getSessionId();
// Modify
log.info("modifying session");
setHandler = new SetAttributesRequestHandler(Collections.singletonMap("count", getAttributeValue(1)), false);
invokeRequest(mgrs[0], setHandler, id);
assertEquals(getAttributeValue(0), setHandler.getCheckedAttributes().get("count"));
// Failover and modify
log.info("failing over");
setHandler = new SetAttributesRequestHandler(Collections.singletonMap("count", getAttributeValue(2)), false);
invokeRequest(mgrs[3], setHandler, id);
assertEquals(getAttributeValue(1), setHandler.getCheckedAttributes().get("count"));
// Modify
log.info("modifying session");
setHandler = new SetAttributesRequestHandler(Collections.singletonMap("count", getAttributeValue(3)), false);
invokeRequest(mgrs[3], setHandler, id);
assertEquals(getAttributeValue(2), setHandler.getCheckedAttributes().get("count"));
// Failback and modify
log.info("failing back");
setHandler = new SetAttributesRequestHandler(Collections.singletonMap("count", getAttributeValue(4)), false);
invokeRequest(mgrs[0], setHandler, id);
assertEquals(getAttributeValue(3), setHandler.getCheckedAttributes().get("count"));
// Invalidate
log.info("invalidating");
InvalidateSessionRequestHandler invalidationHandler = new InvalidateSessionRequestHandler(Collections.singleton("count"), false);
invokeRequest(mgrs[0], invalidationHandler, id);
assertEquals(getAttributeValue(4), invalidationHandler.getCheckedAttributes().get("count"));
// Reestablish
log.info("re-establishing");
setHandler = new SetAttributesRequestHandler(Collections.singletonMap("count", getAttributeValue(0)), false);
invokeRequest(mgrs[0], invalidationHandler, id);
assertNull(setHandler.getCheckedAttributes().get("count"));
}