Skip to content

Instantly share code, notes, and snippets.

@galderz
Created November 13, 2013 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save galderz/9d5ab3623f57ec8b23ee to your computer and use it in GitHub Desktop.
Save galderz/9d5ab3623f57ec8b23ee to your computer and use it in GitHub Desktop.
public void testClusterCacheManagerRestart() {
withCacheManagers(new MultiCacheManagerCallable(
TestCacheManagerFactory.createCacheManager(CacheMode.REPL_SYNC, false),
TestCacheManagerFactory.createCacheManager(CacheMode.REPL_SYNC, false)) {
@Override
public void call() {
EmbeddedCacheManager cm1 = cms[0];
EmbeddedCacheManager cm2 = cms[1];
Cache<Object, Object> c1 = cm1.getCache();
cm2.getCache();
GlobalConfiguration globalCfg = cm1.getCacheManagerConfiguration();
Configuration cfg = c1.getCacheConfiguration();
cm1.stop();
cm1 = new DefaultCacheManager(globalCfg, cfg);
try {
cm1.getCache();
} finally {
TestingUtil.killCacheManagers(cm1);
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment