Package org.jboss.cache.interceptors

Examples of org.jboss.cache.interceptors.InvalidationInterceptor


      assertNotNull("Cache1 retrieval error after unrelated eviction: expected to retrieve " + CAPITAL + " for " + key, cache1.get(key, CAPITAL));

      // Note: because these tests are normally executed without a server, the interceptor
      // MBeans are usually not available for use in the tests.  Consequently it's necessary
      // to obtain a reference to the interceptor and work with it directly.
      InvalidationInterceptor mgmt1 = TestingUtil.findInterceptor(cache1, InvalidationInterceptor.class);
      assertNotNull("Cache1 InvalidationInterceptor not found.", mgmt1);

      InvalidationInterceptor mgmt2 = TestingUtil.findInterceptor(cache2, InvalidationInterceptor.class);
      assertNotNull("Cache2 InvalidationInterceptor not found.", mgmt2);

      assertTrue("Cache1 not configured to use MBeans", cache1.getConfiguration().getExposeManagementStatistics());
      assertTrue("Cache2 not configured to use MBeans", cache2.getConfiguration().getExposeManagementStatistics());
      assertTrue("InvalidationInterceptor on Cache1 not set up to use statistics!", mgmt1.getStatisticsEnabled());
      assertTrue("InvalidationInterceptor on Cache2 not set up to use statistics!", mgmt2.getStatisticsEnabled());

      // verify basic statistics for entries loaded into cache
      assertEquals("Cache1 Invalidations count error: ", new Long(6), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error: ", new Long(9), new Long(mgmt2.getInvalidations()));

      // reset statistics
      mgmt1.resetStatistics();
      mgmt2.resetStatistics();

      // check the statistics again
      assertEquals("Cache1 Invalidations count error after reset: ", new Long(0), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error after reset: ", new Long(0), new Long(mgmt2.getInvalidations()));

   }
View Full Code Here


      assertNotNull("Cache1 retrieval error after unrelated eviction: expected to retrieve " + CAPITAL + " for " + key, cache1.get(key, CAPITAL));

      // Note: because these tests are normally executed without a server, the interceptor
      // MBeans are usually not available for use in the tests.  Consequently it's necessary
      // to obtain a reference to the interceptor and work with it directly.
      InvalidationInterceptor mgmt1 = TestingUtil.findInterceptor(cache1, InvalidationInterceptor.class);
      assertNotNull("Cache1 InvalidationInterceptor not found.", mgmt1);

      InvalidationInterceptor mgmt2 = TestingUtil.findInterceptor(cache2, InvalidationInterceptor.class);
      assertNotNull("Cache2 InvalidationInterceptor not found.", mgmt2);

      assertTrue("Cache1 not configured to use MBeans", cache1.getConfiguration().getExposeManagementStatistics());
      assertTrue("Cache2 not configured to use MBeans", cache2.getConfiguration().getExposeManagementStatistics());
      assertTrue("InvalidationInterceptor on Cache1 not set up to use statistics!", mgmt1.getStatisticsEnabled());
      assertTrue("InvalidationInterceptor on Cache2 not set up to use statistics!", mgmt2.getStatisticsEnabled());

      // verify basic statistics for entries loaded into cache
      assertEquals("Cache1 Invalidations count error: ", new Long(6), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error: ", new Long(9), new Long(mgmt2.getInvalidations()));

      // reset statistics
      mgmt1.resetStatistics();
      mgmt2.resetStatistics();

      // check the statistics again
      assertEquals("Cache1 Invalidations count error after reset: ", new Long(0), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error after reset: ", new Long(0), new Long(mgmt2.getInvalidations()));

   }
View Full Code Here

      assertNotNull("Cache1 retrieval error after unrelated eviction: expected to retrieve " + CAPITAL + " for " + key, cache1.get(key, CAPITAL));

      // Note: because these tests are normally executed without a server, the interceptor
      // MBeans are usually not available for use in the tests.  Consequently it's necessary
      // to obtain a reference to the interceptor and work with it directly.
      InvalidationInterceptor mgmt1 = getInvalidationInterceptor(cache1);
      assertNotNull("Cache1 InvalidationInterceptor not found.", mgmt1);
      InvalidationInterceptor mgmt2 = getInvalidationInterceptor(cache2);
      assertNotNull("Cache2 InvalidationInterceptor not found.", mgmt2);     
    
      // verify basic statistics for entries loaded into cache
      assertEquals("Cache1 Invalidations count error: ", new Long(6), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error: ", new Long(10), new Long(mgmt2.getInvalidations()));
     
      // reset statistics
      mgmt1.resetStatistics();
      mgmt2.resetStatistics();
    
      // check the statistics again
      assertEquals("Cache1 Invalidations count error after reset: ", new Long(0), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error after reset: ", new Long(0), new Long(mgmt2.getInvalidations()));

   }
View Full Code Here

      assertNotNull("Cache1 retrieval error after unrelated eviction: expected to retrieve " + CAPITAL + " for " + key, cache1.get(key, CAPITAL));

      // Note: because these tests are normally executed without a server, the interceptor
      // MBeans are usually not available for use in the tests.  Consequently it's necessary
      // to obtain a reference to the interceptor and work with it directly.
      InvalidationInterceptor mgmt1 = TestingUtil.findInterceptor(cache1, InvalidationInterceptor.class);
      assertNotNull("Cache1 InvalidationInterceptor not found.", mgmt1);

      InvalidationInterceptor mgmt2 = TestingUtil.findInterceptor(cache2, InvalidationInterceptor.class);
      assertNotNull("Cache2 InvalidationInterceptor not found.", mgmt2);

      assertTrue("Cache1 not configured to use MBeans", cache1.getConfiguration().getExposeManagementStatistics());
      assertTrue("Cache2 not configured to use MBeans", cache2.getConfiguration().getExposeManagementStatistics());
      assertTrue("InvalidationInterceptor on Cache1 not set up to use statistics!", mgmt1.getStatisticsEnabled());
      assertTrue("InvalidationInterceptor on Cache2 not set up to use statistics!", mgmt2.getStatisticsEnabled());

      // verify basic statistics for entries loaded into cache
      assertEquals("Cache1 Invalidations count error: ", new Long(6), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error: ", new Long(9), new Long(mgmt2.getInvalidations()));

      // reset statistics
      mgmt1.resetStatistics();
      mgmt2.resetStatistics();

      // check the statistics again
      assertEquals("Cache1 Invalidations count error after reset: ", new Long(0), new Long(mgmt1.getInvalidations()));
      assertEquals("Cache2 Invalidations count error after reset: ", new Long(0), new Long(mgmt2.getInvalidations()));

   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.interceptors.InvalidationInterceptor

Copyright © 2018 www.massapicom. 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.