Package org.springsource.loaded

Examples of org.springsource.loaded.ReloadableType.loadNewVersion()


    String t = "iri.JLRFIsAnnotationPresent";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("truefalse", result.returnValue);
    rtype.loadNewVersion(retrieveRenameRetarget(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("falsetrue", result.returnValue);
  }

  @Test
View Full Code Here


    String t = "clinit.One";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("5", result.returnValue);
    rtype.loadNewVersion("39", retrieveRename(t, t + "2"));

    // use the 'new' ___clinit___ method to drive the static initializer
    Method staticInitializer = rtype.getClazz().getMethod("___clinit___");
    assertNotNull(staticInitializer);
    staticInitializer.invoke(null);
View Full Code Here

    String t = "clinit.Two";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("55", result.returnValue);
    rtype.loadNewVersion("39", retrieveRename(t, t + "2"));
    rtype.runStaticInitializer();
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("99", result.returnValue);
  }
View Full Code Here

    String t = "clinit.Three";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("1", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    rtype.runStaticInitializer();
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("1", result.returnValue);
    rtype.loadNewVersion("3", retrieveRename(t, t + "3"));
    rtype.runStaticInitializer();
View Full Code Here

    assertEquals("1", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    rtype.runStaticInitializer();
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("1", result.returnValue);
    rtype.loadNewVersion("3", retrieveRename(t, t + "3"));
    rtype.runStaticInitializer();
    result = runUnguarded(rtype.getClazz(), "run");
    ClassPrinter.print(rtype.getLatestExecutorBytes());
    assertEquals("4", result.returnValue);
  }
View Full Code Here

    ReloadableType rtypeB = subLoader.loadAsReloadableType("subpkg.Bottom");

    result = runUnguarded(rtypeB.getClazz(), "m");
    assertEquals("Bottom.m() running", result.stdout);

    rtypeB.loadNewVersion("2", retrieveRename("subpkg.Bottom", "subpkg.Bottom002", "superpkg.Top002:superpkg.Top"));
    result = runUnguarded(rtypeB.getClazz(), "m");
    assertEquals("Bottom002.m() running", result.stdout);
  }

  @Test
View Full Code Here

    subLoader.loadAsReloadableType("subpkg.Bottom");

    result = runUnguarded(rtypeA.getClazz(), "m");
    assertEquals("Top.m() running", result.stdout);

    rtypeA.loadNewVersion("2", retrieveRename("superpkg.Top", "superpkg.Top002"));
    result = runUnguarded(rtypeA.getClazz(), "m");
    assertEquals("Top002.m() running", result.stdout);
  }

  /**
 
View Full Code Here

    ReloadableType rtypeA = subLoader.loadAsReloadableType(top);
    ReloadableType rtypeB = subLoader.loadAsReloadableType(bot);

    rtypeA.loadNewVersion("2", retrieveRename(top, top + "003"));
    rtypeB.loadNewVersion("2", retrieveRename(bot, bot + "003", top + "003:" + top));

    // Check the registry looks right for Top
    int topId = NameRegistry.getIdFor("superpkg/Top");
    TypeRegistry trTop = TypeRegistry.getTypeRegistryFor(subLoader.getParent());
    assertEquals(0, topId);
View Full Code Here

    ReloadableType targetR = subLoader.loadAsReloadableType(target);
    ReloadableType invokerR = subLoader.loadAsReloadableType(invoker);

    targetR.loadNewVersion("2", retrieveRename(target, target + "002"));
    invokerR.loadNewVersion("2", retrieveRename(invoker, invoker + "002", target + "002:" + target));

    // Check the registry looks right for target
    int targetId = NameRegistry.getIdFor(toSlash(target));
    assertEquals(0, targetId);
    TypeRegistry trtarget = TypeRegistry.getTypeRegistryFor(subLoader.getParent());
View Full Code Here

    ReloadableType targetR = subLoader.loadAsReloadableType(target);
    ReloadableType invokerR = subLoader.loadAsReloadableType(invoker);

    targetR.loadNewVersion("2", retrieveRename(target, target + "002"));
    invokerR.loadNewVersion("2", retrieveRename(invoker, invoker + "002", target + "002:" + target));

    // Check the registry looks right for target
    int targetId = NameRegistry.getIdFor(toSlash(target));
    assertEquals(0, targetId);
    TypeRegistry trtarget = TypeRegistry.getTypeRegistryFor(subLoader.getParent());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.