Registry r = buildRegistry(ReloadAwareModule.class);
assertEquals(ReloadAwareModule.counterInstantiations, 0);
assertEquals(ReloadAwareModule.counterReloads, 0);
Counter counter = r.proxy(Counter.class, CounterImpl.class);
assertEquals(ReloadAwareModule.counterInstantiations, 0);
assertEquals(counter.increment(), 1);
assertEquals(counter.increment(), 2);
assertEquals(ReloadAwareModule.counterInstantiations, 1);
URL classURL = CounterImpl.class.getResource("CounterImpl.class");
File classFile = new File(classURL.toURI());
touch(classFile);
assertEquals(ReloadAwareModule.counterInstantiations, 1);
assertEquals(ReloadAwareModule.counterReloads, 0);
fireUpdateCheck(r);
assertEquals(ReloadAwareModule.counterInstantiations, 2);
assertEquals(ReloadAwareModule.counterReloads, 1);
// Check that internal state has reset
assertEquals(counter.increment(), 1);
r.shutdown();
}