public void closure3() throws Exception {
String t = "simple.BasicWithClosureC";
String c = "simple.BasicWithClosureC$_run_closure1";
String c2 = "simple.BasicWithClosureC$_run_closure1_closure2";
TypeRegistry r = getTypeRegistry(t + "," + c + "," + c2);
ReloadableType ctype = r.addType(c, loadBytesForClass(c));
ReloadableType c2type = r.addType(c2, loadBytesForClass(c2));
ReloadableType rtype = r.addType(t, loadBytesForClass(t));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("foo() running\nin closure", result.stdout);
rtype.loadNewVersion(
"2",
retrieveRename(t, t + "2", "simple.BasicWithClosureC2$_run_closure1:simple.BasicWithClosureC$_run_closure1",
"simple.BasicWithClosureC2:simple.BasicWithClosureC"));
c2type.loadNewVersion(
"2",
retrieveRename(c2, "simple.BasicWithClosureC2$_run_closure1_closure2",
"simple.BasicWithClosureC2$_run_closure1:simple.BasicWithClosureC$_run_closure1",
"simple.BasicWithClosureC2:simple.BasicWithClosureC"));
ctype.loadNewVersion(
"2",
retrieveRename(c, "simple.BasicWithClosureC2$_run_closure1",
"simple.BasicWithClosureC2$_run_closure1_closure2:simple.BasicWithClosureC$_run_closure1_closure2",
"simple.BasicWithClosureC2:simple.BasicWithClosureC"));
result = runUnguarded(rtype.getClazz(), "run");
assertEquals("in closure\nfoo() running", result.stdout);
//
// // code in closure changes
// ctype.loadNewVersion("3", retrieveRename(c,
// "simple.BasicWithClosureB3$_closure1"));