use of org.infinispan.counter.configuration.StrongCounterConfiguration in project infinispan by infinispan.
the class ConfigurationTest method assertBoundedStrongCounter.
private void assertBoundedStrongCounter(CounterManagerConfiguration config, String name, long initialValue, long min, long max, long lifespan, Storage storage) {
for (AbstractCounterConfiguration counterConfig : config.counters().values()) {
if (counterConfig.name().equals(name)) {
assertTrue(counterConfig instanceof StrongCounterConfiguration);
assertEquals(initialValue, counterConfig.initialValue());
assertEquals(storage, counterConfig.storage());
assertTrue(((StrongCounterConfiguration) counterConfig).isBound());
assertEquals(min, ((StrongCounterConfiguration) counterConfig).lowerBound());
assertEquals(max, ((StrongCounterConfiguration) counterConfig).upperBound());
assertEquals(lifespan, ((StrongCounterConfiguration) counterConfig).lifespan());
return;
}
}
fail();
}
use of org.infinispan.counter.configuration.StrongCounterConfiguration in project infinispan by infinispan.
the class ConfigurationTest method assertUnboundedStrongCounter.
private void assertUnboundedStrongCounter(CounterManagerConfiguration config) {
for (AbstractCounterConfiguration counterConfig : config.counters().values()) {
if (counterConfig.name().equals("unbounded-strong-1")) {
assertTrue(counterConfig instanceof StrongCounterConfiguration);
assertEquals(1, counterConfig.initialValue());
assertEquals(-1, ((StrongCounterConfiguration) counterConfig).lifespan());
assertEquals(Storage.VOLATILE, counterConfig.storage());
return;
}
}
fail();
}
Aggregations