Examples of ExtendedStatisticInterceptor


Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testPutIfAbsent() {
      assertEmpty(KEY_1, KEY_2);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.putIfAbsent(KEY_1, VALUE_2);

      assertCacheValue(KEY_1, VALUE_1);

      cache.put(KEY_1, VALUE_3);

      assertCacheValue(KEY_1, VALUE_3);

      cache.putIfAbsent(KEY_1, VALUE_4);

      assertCacheValue(KEY_1, VALUE_3);

      cache.putIfAbsent(KEY_2, VALUE_1);

      assertCacheValue(KEY_2, VALUE_1);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testRemoveIfPresent() {
      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.remove(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_2);

      cache.remove(KEY_1, VALUE_2);

      assertCacheValue(KEY_1, null);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testClear() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.clear();

      assertCacheValue(KEY_1, null);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   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());
   }
View Full Code Here

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   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());
   }
View Full Code Here

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testRemoveUnexistingEntry() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.remove(KEY_1);

      assertCacheValue(KEY_1, null);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.LOCAL, true);
      builder.locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
      builder.transaction().recovery().disable();
      builder.customInterceptors().addInterceptor().interceptor(new ExtendedStatisticInterceptor())
            .position(InterceptorConfiguration.Position.FIRST);
      return TestCacheManagerFactory.createCacheManager(builder);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.