request.setCacheId("600");
request.setMessageInfo(TestConstants.cacheCmd);
sessionService2.execute(request);
// 4: start cache guardian1 for client2 - do nothing
SCSubscribeMessage subMsg = new SCSubscribeMessage();
subMsg.setMask(TestConstants.mask);
subMsg.setSessionInfo(TestConstants.doNothingCmd);
GuardianCbk cacheGuardianCbk2 = new GuardianCbk();
client2.startCacheGuardian(TestConstants.cacheGuardian1, subMsg, cacheGuardianCbk2);
// 5: start cache guardian1 for client1 - publish 3 large appendix, cid=700
subMsg.setData("700");
subMsg.setSessionInfo(TestConstants.publish3LargeAppendixMsgCmd);
sessionClient.startCacheGuardian(TestConstants.cacheGuardian1, subMsg, cacheGuardianCbk);
// 6: verify callback of client1 guardian1 retrieval - 3 appendix within 10sec
cacheGuardianCbk.waitForAppendMessage(3, 10);
// 7: verify callback of client2 guardian1 retrieval - 3 appendix within 10sec
cacheGuardianCbk2.waitForAppendMessage(3, 10);
// 8: verify data (cid=600) is now in top level cache
Map<String, String> inspectResponse = guardianClient.inspectCache("600");
this.checkCacheInspectString(inspectResponse, "success", SC_CACHE_ENTRY_STATE.LOADED, "600", "0", "600/0/0=0&", "unset");
// 9: verify data (cid=700) is now in top level cache
inspectResponse = guardianClient.inspectCache("700");
this.checkCacheInspectString(inspectResponse, "success", SC_CACHE_ENTRY_STATE.LOADED, "700", "3",
"700/0/0=0&700/1/0=1&700/2/0=1&700/3/0=1&", TestConstants.cacheGuardian1);
// 10: change subscription for client2 different mask
subMsg.setMask(TestConstants.mask1);
subMsg.setSessionInfo(null);
client2.changeCacheGuardian(subMsg);
// 11: restart cache guardian of client1 - publish 3 large appendix, different mask
sessionClient.stopCacheGuardian();
subMsg.setData("600");
subMsg.setSessionInfo(TestConstants.publish3LargeAppendixMsgCmd);
subMsg.setMask(TestConstants.mask1);
sessionClient.startCacheGuardian(TestConstants.cacheGuardian1, subMsg, cacheGuardianCbk);
// 12: verify callback of client1 guardian1 retrieval - 3 appendix within 10sec
cacheGuardianCbk.waitForAppendMessage(3, 10);