public void testSingleInvocation() {
final EmbeddedCacheManager cacheManager = manager(0);
GlobalComponentRegistry registry = (GlobalComponentRegistry) TestingUtil.extractField(cacheManager, "globalComponentRegistry");
List<ModuleLifecycle> lifecycles = new LinkedList<ModuleLifecycle>();
TestingUtil.replaceField(lifecycles, "moduleLifecycles", registry, GlobalComponentRegistry.class);
lifecycles.add(new AbstractModuleLifecycle() {
@Override
public void cacheStarting(ComponentRegistry cr, Configuration configuration, String cacheName) {
log.debug("StartCacheFromListenerTest.cacheStarting");
if (!cacheStartingInvoked.get()) {
cacheStartingInvoked.set(true);