Package org.springsource.loaded

Examples of org.springsource.loaded.TypeRegistry.addType()


  @Test
  public void basic() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.Basic";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("goodbye", result.returnValue);
View Full Code Here


  @Test
  public void basicInstance() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.Basic";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    Object instance = null;
    instance = rtype.getClazz().newInstance();

    // First method call to 'run' should return "hello"
    result = runOnInstance(rtype.getClazz(), instance, "run");
View Full Code Here

  @Test
  public void basic2() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicB";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("goodbye", result.returnValue);
View Full Code Here

  @Test
  public void basic3() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicC";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("goodbye", result.returnValue);
View Full Code Here

  public void basic4() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicD";
    String target = "simple.BasicDTarget";
    TypeRegistry r = getTypeRegistry(t + "," + target);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    rtypeTarget.loadNewVersion("2", retrieveRename(target, target + "2"));
View Full Code Here

    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicD";
    String target = "simple.BasicDTarget";
    TypeRegistry r = getTypeRegistry(t + "," + target);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    rtypeTarget.loadNewVersion("2", retrieveRename(target, target + "2"));
    result = runUnguarded(rtype.getClazz(), "run");
View Full Code Here

    String t = "simple.BasicE";
    String target = "simple.BasicETarget";

    TypeRegistry r = getTypeRegistry(t + "," + target);

    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));

    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
View Full Code Here

    String target = "simple.BasicETarget";

    TypeRegistry r = getTypeRegistry(t + "," + target);

    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));

    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);

    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
View Full Code Here

    // GlobalConfiguration.logging = true;
    // GlobalConfiguration.isRuntimeLogging = true;

    TypeRegistry r = getTypeRegistry(t + "," + target);

    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));

    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("123", result.returnValue);
View Full Code Here

    // GlobalConfiguration.isRuntimeLogging = true;

    TypeRegistry r = getTypeRegistry(t + "," + target);

    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));

    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("123", result.returnValue);

    // rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
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.