use of org.cache2k.Cache2kBuilder in project cache2k by cache2k.
the class Cache2kBuilderTest method anonymousWithoutTypes.
@Test(expected = IllegalArgumentException.class)
public void anonymousWithoutTypes() {
Cache c = new Cache2kBuilder() {
}.eternal(true).build();
c.clear();
}
use of org.cache2k.Cache2kBuilder 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.Cache2kBuilder 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();
}
Aggregations