use of org.infinispan.extendedstats.wrappers.ExtendedStatisticInterceptor in project infinispan by infinispan.
the class LocalExtendedStatisticTest method testPut.
public void testPut() {
assertEmpty(KEY_1, KEY_2, KEY_3);
ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);
cache.put(KEY_1, VALUE_1);
assertCacheValue(KEY_1, VALUE_1);
Map<Object, Object> map = new HashMap<>();
map.put(KEY_2, VALUE_2);
map.put(KEY_3, VALUE_3);
cache.putAll(map);
assertCacheValue(KEY_1, VALUE_1);
assertCacheValue(KEY_2, VALUE_2);
assertCacheValue(KEY_3, VALUE_3);
assertNoTransactions();
Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
}
use of org.infinispan.extendedstats.wrappers.ExtendedStatisticInterceptor in project infinispan by infinispan.
the class LocalExtendedStatisticTest method removeTest.
public void removeTest() {
assertEmpty(KEY_1);
ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);
cache.put(KEY_1, VALUE_1);
assertCacheValue(KEY_1, VALUE_1);
cache.remove(KEY_1);
assertCacheValue(KEY_1, null);
cache.put(KEY_1, VALUE_1);
assertCacheValue(KEY_1, VALUE_1);
cache.remove(KEY_1);
assertCacheValue(KEY_1, null);
assertNoTransactions();
Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
}
use of org.infinispan.extendedstats.wrappers.ExtendedStatisticInterceptor in project infinispan by infinispan.
the class LocalExtendedStatisticTest method getExtendedStatistic.
private ExtendedStatisticInterceptor getExtendedStatistic(Cache<?, ?> cache) {
AsyncInterceptorChain interceptorChain = cache.getAdvancedCache().getAsyncInterceptorChain();
ExtendedStatisticInterceptor extendedStatisticInterceptor = interceptorChain.findInterceptorExtending(ExtendedStatisticInterceptor.class);
if (extendedStatisticInterceptor != null) {
extendedStatisticInterceptor.resetStatistics();
}
return extendedStatisticInterceptor;
}
use of org.infinispan.extendedstats.wrappers.ExtendedStatisticInterceptor in project infinispan by infinispan.
the class LocalExtendedStatisticTest method testReplace.
public void testReplace() {
assertEmpty(KEY_1);
ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);
cache.put(KEY_1, VALUE_1);
assertCacheValue(KEY_1, VALUE_1);
Assert.assertEquals(cache.replace(KEY_1, VALUE_2), VALUE_1);
assertCacheValue(KEY_1, VALUE_2);
cache.put(KEY_1, VALUE_3);
assertCacheValue(KEY_1, VALUE_3);
cache.replace(KEY_1, VALUE_3);
assertCacheValue(KEY_1, VALUE_3);
cache.put(KEY_1, VALUE_4);
assertCacheValue(KEY_1, VALUE_4);
assertNoTransactions();
Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
}
use of org.infinispan.extendedstats.wrappers.ExtendedStatisticInterceptor in project infinispan by infinispan.
the class LocalExtendedStatisticTest method testReplaceWithOldVal.
public void testReplaceWithOldVal() {
assertEmpty(KEY_1);
ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);
cache.put(KEY_1, VALUE_1);
assertCacheValue(KEY_1, VALUE_1);
cache.put(KEY_1, VALUE_2);
assertCacheValue(KEY_1, VALUE_2);
cache.replace(KEY_1, VALUE_3, VALUE_4);
assertCacheValue(KEY_1, VALUE_2);
cache.replace(KEY_1, VALUE_2, VALUE_4);
assertCacheValue(KEY_1, VALUE_4);
assertNoTransactions();
Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
}
Aggregations