Examples of loadNewVersion()


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

    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"));
    rtype.runStaticInitializer(); // call is made on reloadable type
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("7", result.returnValue);
  }
View Full Code Here

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

      fail();
    } catch (InvocationTargetException ite) {
      // success - var2 doesn't exist yet
    }

    rtypeb.loadNewVersion("2", retrieveRename(b, b + "2"));

    result = runUnguarded(rtypea.getClazz(), "run2");
    assertEquals(3355, result.returnValue);
  }
View Full Code Here

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

    result = runUnguarded(rtypea.getClazz(), "run");
    assertEquals("abc", result.returnValue);
    result = runUnguarded(rtypea.getClazz(), "run2");
    assertEquals(99, result.returnValue);

    rtypea.loadNewVersion("2", retrieveRename(a, a + "2"));

    result = runUnguarded(rtypea.getClazz(), "run");
    assertEquals("xxx", result.returnValue);
    result = runUnguarded(rtypea.getClazz(), "run2");
    assertEquals(88, result.returnValue);
View Full Code Here

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

      fail();
    } catch (Exception e) {
      // success - var2 doesn't exist yet
    }
    // rtypea.fixupGroovyType();
    rtypeb.loadNewVersion("2", retrieveRename(b, b + "2"));

    result = runOnInstance(rtypea.getClazz(), instance, "run2");
    // The field will not be initialized, so will contain 0
    assertEquals(0, result.returnValue);
  }
View Full Code Here

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

    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);
  }

  @Test
View Full Code Here

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

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

    // Version 3 makes run() call another local method to get the string
    // "abc"
    rtype.loadNewVersion("3", retrieveRename(t, t + "3"));

    // Field f = rtype.getClazz().getDeclaredField("metaClass");
    // f.setAccessible(true);
    // Object mc = f.get(instance);
    // System.out.println("Metaclass is currently " + mc);
View Full Code Here

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

    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);
  }

  // Similar to BasicB but now using non-static methods
View Full Code Here

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

    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);
  }

  // Now calling between two different types to check if we have
View Full Code Here

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

    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");
    assertEquals("abc", result.returnValue);
  }

  // Calling from one type to another, now the methods are non-static
View Full Code Here

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

    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");
    assertEquals("foobar", result.returnValue);
  }
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.