Examples of cacheKeyGenerator()


Examples of javax.cache.annotation.CacheResult.cacheKeyGenerator()

   public void testGetCacheKeyGeneratorWithoutMethodCacheKeyGeneratorAndDefault() throws Exception {
      final Method fooMethod = Foo.class.getMethod("fooMethod", String.class, String.class);
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Foo.class.getAnnotation(CacheDefaults.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof FooCacheKeyGenerator);
   }

   public void testCacheKeyGeneratorWithMethodCacheKeyGeneratorAndDefault() throws Exception {
View Full Code Here

Examples of javax.cache.annotation.CacheResult.cacheKeyGenerator()

   public void testCacheKeyGeneratorWithMethodCacheKeyGeneratorAndDefault() throws Exception {
      final Method barMethod = Foo.class.getMethod("barMethod");
      final CacheResult cacheResultAnnotation = barMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Foo.class.getAnnotation(CacheDefaults.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof BarCacheKeyGenerator);
   }

   public void testCacheKeyGeneratorNameWithoutMethodCacheKeyGeneratorWithoutDefault() throws Exception {
View Full Code Here

Examples of javax.cache.annotation.CacheResult.cacheKeyGenerator()

   public void testCacheKeyGeneratorNameWithoutMethodCacheKeyGeneratorWithoutDefault() throws Exception {
      final Method fooMethod = Bar.class.getMethod("fooMethod");
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Bar.class.getAnnotation(CacheDefaults.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof DefaultCacheKeyGenerator);
   }

   public void testGetCacheKeyGeneratorWithMethodCacheKeyGeneratorWithoutDefault() throws Exception {
View Full Code Here

Examples of javax.cache.annotation.CacheResult.cacheKeyGenerator()

   public void testGetCacheKeyGeneratorWithMethodCacheKeyGeneratorWithoutDefault() throws Exception {
      final Method barMethod = Bar.class.getMethod("barMethod");
      final CacheResult cacheResultAnnotation = barMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Bar.class.getAnnotation(CacheDefaults.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof BarCacheKeyGenerator);
   }

   public void testGetCacheKeyGeneratorWithANonManagedCacheKeyGenerator() throws Exception {
View Full Code Here

Examples of javax.cache.annotation.CacheResult.cacheKeyGenerator()

   public void testGetCacheKeyGeneratorWithANonManagedCacheKeyGenerator() throws Exception {
      final Method bazMethod = Foo.class.getMethod("bazMethod");
      final CacheResult cacheResultAnnotation = bazMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Bar.class.getAnnotation(CacheDefaults.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof BazCacheKeyGenerator);
   }

   /**
 
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.