Package org.springsource.loaded

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


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

    // rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    rtypeTarget.loadNewVersion("2", retrieveRename(target, target + "2"));

    result = null;

    // The target method has been removed, should now fail to call it
    try {
View Full Code Here


    } catch (InvocationTargetException ite) {
      // success
    }

    // Load the original back in, should work again
    rtypeTarget.loadNewVersion("3", retrieveRename(target, target));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("123", result.returnValue);

    // rtype.loadNewVersion("2", rtype.bytesInitial); //reload yourself
View Full Code Here

    assertEquals("123", result.returnValue);

    // rtype.loadNewVersion("2", rtype.bytesInitial); //reload yourself

    // Load a new version that now returns an int
    rtypeTarget.loadNewVersion("4", retrieveRename(target, target + "4"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("4456", result.returnValue);

  }
View Full Code Here

      ite.printStackTrace();
      assertCause(ite, "MissingMethodException");
    }

    // Now a version of BasicGTarget is loaded that does define the method
    rtypeTarget.loadNewVersion("2", retrieveRename(target, target + "2"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hw", result.returnValue);

    // Now load the original version so the method is gone again
    rtypeTarget.loadNewVersion("3", rtypeTarget.bytesInitial);// retrieveRename(target,
View Full Code Here

    rtypeTarget.loadNewVersion("2", retrieveRename(target, target + "2"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hw", result.returnValue);

    // Now load the original version so the method is gone again
    rtypeTarget.loadNewVersion("3", rtypeTarget.bytesInitial);// retrieveRename(target,
                                  // target +
                                  // "2"));
    try {
      result = runUnguarded(rtype.getClazz(), "run");
      fail();
View Full Code Here

    // loadBytesForClass(target));

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

    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    // rtypeTarget.loadNewVersion("2", retrieveRename(target, target +
    // "2"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals(new Integer(456), result.returnValue);
    //
View Full Code Here

    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("Executing:hello!", result.stdout);

    rtype.loadNewVersion("2",
        retrieveRename(t, t + "2", "simple.BasicWithClosure2$_run_closure1:simple.BasicWithClosure$_run_closure1"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("Executing:hello!", result.stdout);

    // Change what the closure does and reload it
View Full Code Here

    ctype.loadNewVersion("3", retrieveRename(c, "simple.BasicWithClosure3$_run_closure1"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("Executing:goodbye!", result.stdout);

    // reload an unchanged version - should behave as before
    rtype.loadNewVersion("3",
        retrieveRename(t, t + "3", "simple.BasicWithClosure3$_run_closure1:simple.BasicWithClosure$_run_closure1"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("Executing:goodbye!", result.stdout);
  }
View Full Code Here

    ReloadableType ctype = r.addType(c, loadBytesForClass(c));
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("Executing:hello!", result.stdout);

    rtype.loadNewVersion("2",
        retrieveRename(t, t + "2", "simple.BasicWithClosureB2$_closure1:simple.BasicWithClosureB$_closure1"));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("Executing:hello!", result.stdout);

    // code in closure changes
View Full Code Here

    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(
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.