*/
public void testLoadClassAfterResourceStoreRemoved() {
// Create a class loader & add resource store
ReloadingClassLoader loader = new ReloadingClassLoader(this.getClass().getClassLoader());
MemoryResourceStore store = new MemoryResourceStore();
loader.addResourceStore(store);
// Check "jci.Simple" class can't be loaded
try {
Object simple1 = loader.loadClass("jci.Simple").newInstance();
fail("Success loadClass[1]");
} catch(ClassNotFoundException e) {
// expected not found
} catch(Exception e) {
log.error(e);
fail("Error loadClass[1]: " + e);
}
// Add "jci.Simple" class to the resource store
String toStringValue = "FooBar";
try {
byte[] classBytes = SimpleDump.dump(toStringValue);
store.write("jci/Simple.class", classBytes);
} catch(Exception e) {
log.error(e);
fail("Error adding class to store: " + e);
}