assert load(stores[0], key).equals(expected.get(key));
assert load(stores[1], key) == null;
assert load(stores[2], key) == null;
}
ViewChangeListener viewChangeListener = new ViewChangeListener(caches[1]);
cm0.stop();
viewChangeListener.waitForViewChange(60, TimeUnit.SECONDS);
waitForPushStateCompletion(stores[1].pushStateFuture);
// cache store 1 should have all state now, and store 2 should have nothing
for (String key : expected.keySet()) {
assert load(stores[1], key).equals(expected.get(key));
assert load(stores[2], key) == null;
}
caches[1].put("h-key", "h-value");
caches[2].put("i-key", "i-value");
expected.put("h-key", "h-value");
expected.put("i-key", "i-value");
for (String key : expected.keySet()) {
assert load(stores[1], key).equals(expected.get(key));
assert load(stores[2], key) == null;
}
viewChangeListener = new ViewChangeListener(caches[2]);
cm1.stop();
viewChangeListener.waitForViewChange(60, TimeUnit.SECONDS);
waitForPushStateCompletion(stores[2].pushStateFuture);
for (String key : expected.keySet()) assert load(stores[2], key).equals(expected.get(key));