use of org.cache2k.Cache in project cache2k by cache2k.
the class IntegrationTest method notPresent.
@Test
public void notPresent() {
Cache c = new Cache2kBuilder<String, String>() {
}.manager(CacheManager.getInstance("notPresent")).name("anyCache").build();
c.close();
}
use of org.cache2k.Cache in project cache2k by cache2k.
the class IntegrationTest method defaultManagerName.
/**
* The name of the default manager is set by the configuration.
*/
@Test
@Ignore
public void defaultManagerName() {
Cache c = Cache2kBuilder.forUnknownTypes().name("flowers").build();
assertTrue("default manager", c.getCacheManager().isDefaultManager());
assertEquals("myApp", c.getCacheManager().getName());
c.close();
}
use of org.cache2k.Cache in project cache2k by cache2k.
the class IntegrationTest method eternal_configExpire.
@Test
public void eternal_configExpire() {
try {
Cache c = new Cache2kBuilder<String, String>() {
}.manager(CacheManager.getInstance("specialCases")).name("withExpiry").eternal(true).build();
c.close();
fail("expect exception");
} catch (ConfigurationException ex) {
assertThat(ex.getMessage(), containsString("Value '2d' rejected: eternal enabled explicitly, refusing to enable expiry at"));
}
}
use of org.cache2k.Cache in project cache2k by cache2k.
the class IntegrationTest method ignoreAnonymousCache.
@Test
public void ignoreAnonymousCache() {
Cache c = new Cache2kBuilder<String, String>() {
}.manager(CacheManager.getInstance("specialCases")).build();
c.close();
}
use of org.cache2k.Cache in project cache2k by cache2k.
the class ManagerMXBeanImpl method getHealthStatus.
@Override
public String getHealthStatus() {
List<HealthInfoElement> li = new ArrayList<HealthInfoElement>();
for (Cache c : manager.getActiveCaches()) {
InternalCache ic = (InternalCache) c;
li.addAll(ic.getInfo().getHealth());
}
sortHealthInfoList(li);
return constructHealthString(li);
}
Aggregations