@Test
    void testLazyCacheManagerCreationWithoutCallingInit() {
        net.sf.ehcache.CacheManager ehCacheManager = cacheManager.getCacheManager();
        assertNull(ehCacheManager);

        //don't call init here - the ehcache CacheManager should be lazily created
        //because of the default Shiro ehcache.xml file in the classpath.  Just acquire a cache:
        Cache<String, String> cache = cacheManager.getCache("test");

        //now assert that an internal CacheManager has been created:
        ehCacheManager = cacheManager.getCacheManager();
        assertNotNull(ehCacheManager);

        assertNotNull(cache);
        cache.put("hello", "world");
        String value = cache.get("hello");
        assertNotNull(value);
        assertEquals("world", value);
    }
TODO - Class JavaDoc

@since May 11, 2010 12:41:38 PM
support/ehcache/src/test/java/org/apache/shiro/cache/ehcache/EhCacheManagerTest.java