InfinispanCacheManager extends CacheManager { public <K,V> Map<K,V> getCache(String name) { CacheContainer container=getCacheContainer(); if (container == null) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Requested cache '"+name +"', but no cache container ("+_container+")"); } return (null); } Map<K,V> ret=container.<K,V>getCache(name); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Returning cache '"+name +"' = "+ret); } return (ret); } InfinispanCacheManager(); void setContainer(String jndiName); String getContainer(); Map<K,V> getCache(String name); boolean lock(String cacheName, Object key);  }
@Test public void testConfigPut() { InfinispanCacheManager cm=new InfinispanCacheManager(); try { cm.init(); } catch (Exception e) { fail("Failed to initialize infinispan cache manager: "+e); } java.util.Map<Object,Object> cache=cm.getCache("Principals"); if (cache == null) { fail("Failed to get 'Principals' cache"); } cache.clear(); cache.put(TEST_KEY, TEST_VALUE); if (!cache.containsKey(TEST_KEY)) { fail("Value not found"); } Object value=cache.get(TEST_KEY); if (!value.equals(TEST_VALUE)) { fail("Value is incorrect: "+value); } cache.clear(); }