c2 = null;
}
public void testUseOfInvalidRegion()
{
Fqn fqn = Fqn.fromString("/a/b/c/d");
c1.getRegion(fqn.getParent(), true).registerContextClassLoader(getClass().getClassLoader());
c2.getRegion(fqn.getParent(), true).registerContextClassLoader(getClass().getClassLoader());
replListener2.expect(PutKeyValueCommand.class);
// write something; will cause a stale region to be stored in C2's cache marshaller
c1.put(fqn, "k", "v");
assert c1.get(fqn, "k").equals("v");
replListener2.waitForReplicationToOccur(250);
// assert that this made it to c2
assert c2.get(fqn, "k").equals("v");
// c2's cache marshaller's thread local would be polluted now.
// restart c1 so that it forces a state transfer from c2
c1.destroy();
c1.create();
Region r = c1.getRegion(fqn.getParent(), true);
r.registerContextClassLoader(getClass().getClassLoader());
r.deactivate();
c1.start();
TestingUtil.blockUntilViewsReceived(60000, c1, c2);