!config.isTemplateCacheRequired());
config.setTemplateCacheRequired(true);
assertTrue("Should now use a cache", config.isTemplateCacheRequired());
GenericCache cache = (GenericCache)
((DefaultTransformConfiguration)config).getTemplateCache();
assertNotNull("Should have a cache", cache);
String strategy = cache.getStrategy();
assertNull("No strategy specified", strategy);
// GenericCache sets this to 0 even though our cache construction
// specified -1
int max = cache.getMaxEntries();
assertEquals("No limit on entries", 0, max);
int timeout = cache.getTimeout();
assertEquals("No timeout on entries", -1, timeout);
// Test repeated requests do not kill an existing cache
GenericCache secondCache = (GenericCache)
((DefaultTransformConfiguration)config).getTemplateCache();
assertNotNull("Should have a cache", secondCache);
assertEquals("Caches should be the same", cache, secondCache);
}