SimpleCache afCache = new SimpleCache();
AFWeaver.setDefaultCacheProvider(afCache);
AFWeaver.addStaticConfiguration(getConfig(CONFIG));
AFWeaver afWeaver = new AFWeaver(CONFIG, new JavaInspector(Administrator.class));
Context context = new Context(Administrator.class.getName(), null, null, null, false);
String fragment = afWeaver.generate(context, keyA);
assertEquals(afCache.get(keyA), fragment);
fragment = afWeaver.generate(context, keyA);
assertEquals(afCache.get(keyA), fragment);
fragment = afWeaver.generate(context, new Settings(), keyB);
assertEquals(afCache.get(keyB), fragment);
fragment = afWeaver.generate(context, new Settings(), keyB);
assertEquals(afCache.get(keyB), fragment);
fragment = afWeaver.generate(context, regionA, keyAregA);
assertEquals(afCache.get(regionA, keyAregA), fragment);
fragment = afWeaver.generate(context, regionA, keyAregA);
assertEquals(afCache.get(regionA, keyAregA), fragment);
fragment = afWeaver.generate(context, new Settings(), regionB, keyAregB);
assertEquals(afCache.get(regionB, keyAregB), fragment);
fragment = afWeaver.generate(context, new Settings(), regionB, keyAregB);
assertEquals(afCache.get(regionB, keyAregB), fragment);
}