Пример #1
0
 @PostConstruct
 public void generateCache() {
   m = new DefaultCacheManager();
   Configuration c = new Configuration();
   m.defineConfiguration("defaultCache", c);
   cache = m.getCache("defaultCache");
 }
 @Test(expected = CacheException.class)
 public void testTimestampValidation() {
   Properties p = createProperties();
   final DefaultCacheManager manager =
       new DefaultCacheManager(GlobalConfigurationBuilder.defaultClusteredBuilder().build());
   try {
     InfinispanRegionFactory factory = createRegionFactory(manager, p);
     ConfigurationBuilder builder = new ConfigurationBuilder();
     builder.clustering().cacheMode(CacheMode.INVALIDATION_SYNC);
     manager.defineConfiguration("timestamps", builder.build());
     factory.start(null, p);
     fail("Should have failed saying that invalidation is not allowed for timestamp caches.");
   } finally {
     TestingUtil.killCacheManagers(manager);
   }
 }
Пример #3
0
 @Test
 public void testDefineNamedCache() {
   DefaultCacheManager cacheManager = new DefaultCacheManager(new ConfigurationBuilder().build());
   cacheManager.defineConfiguration("foo", new ConfigurationBuilder().build());
 }