use of org.cache2k.CacheManager in project cache2k by cache2k.
the class JmxSupportTest method managerClear_noCache.
@Test
public void managerClear_noCache() throws Exception {
String _name = getClass().getName() + ".managerClear_noCache";
CacheManager m = CacheManager.getInstance(_name);
server.invoke(getCacheManagerObjectName(_name), "clear", new Object[0], new String[0]);
m.close();
}
use of org.cache2k.CacheManager in project cache2k by cache2k.
the class JmxSupportTest method emptyCacheManager_healthOkay.
@Test
public void emptyCacheManager_healthOkay() throws Exception {
String _name = getClass().getName() + ".emptyCacheManager_healthOkay";
CacheManager m = CacheManager.getInstance(_name);
MBeanInfo i = getCacheManagerInfo(_name);
assertEquals(ManagerMXBeanImpl.class.getName(), i.getClassName());
String _health = (String) server.getAttribute(getCacheManagerObjectName(_name), "HealthStatus");
assertEquals("ok", _health);
m.close();
}
use of org.cache2k.CacheManager in project cache2k by cache2k.
the class JmxSupportTest method managerAttributes.
@Test
public void managerAttributes() throws Exception {
String _name = getClass().getName() + ".managerAttributes";
CacheManager m = CacheManager.getInstance(_name);
objectName = getCacheManagerObjectName(_name);
checkAttribute("Version", ((CacheManagerImpl) m).getVersion());
checkAttribute("BuildNumber", ((CacheManagerImpl) m).getBuildNumber());
m.close();
}
use of org.cache2k.CacheManager in project cache2k by cache2k.
the class LegalNamesTest method testManager.
@Test
public void testManager() throws Exception {
CacheManager cm = CacheManager.getInstance(LegalNamesTest.class.getName() + "-char-" + aChar);
MBeanInfo inf = JmxSupportTest.getCacheManagerInfo(cm.getName());
assertNotNull(inf);
Cache2kBuilder.forUnknownTypes().manager(cm).name("dummy").build();
cm.close();
}
use of org.cache2k.CacheManager in project cache2k by cache2k.
the class Cache2kBuilderTest method duplicateCacheName.
@Test
public void duplicateCacheName() {
String _managerName = getClass().getName() + ".duplicateCacheName";
Log.registerSuppression(CacheManager.class.getName() + ":" + _managerName, new Log.SuppressionCounter());
CacheManager mgr = CacheManager.getInstance(_managerName);
try {
Cache c0 = Cache2kBuilder.forUnknownTypes().manager(mgr).eternal(true).name(this.getClass(), "same").build();
Cache c1 = Cache2kBuilder.forUnknownTypes().manager(mgr).eternal(true).name(this.getClass(), "same").build();
fail("exception expected");
} catch (IllegalStateException ex) {
}
mgr.close();
}
Aggregations