Package org.springsource.loaded

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


    ReloadableType rtype = typeRegistry.addType("data.HelloWorldClinit", loadBytesForClass("data.HelloWorldClinit"));

    runUnguarded(rtype.getClazz(), "greet");

    // Just transform the existing version into a dispatcher/executor
    rtype.loadNewVersion("000", rtype.bytesInitial);
    assertEquals("Greet from HelloWorldClinit", runUnguarded(rtype.getClazz(), "greet").stdout);

    // Load a real new version
    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldClinit", "data.HelloWorldClinit002"));
    assertEquals("Greet from HelloWorldClinit 2", runUnguarded(rtype.getClazz(), "greet").stdout);
View Full Code Here


    // Just transform the existing version into a dispatcher/executor
    rtype.loadNewVersion("000", rtype.bytesInitial);
    assertEquals("Greet from HelloWorldClinit", runUnguarded(rtype.getClazz(), "greet").stdout);

    // Load a real new version
    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldClinit", "data.HelloWorldClinit002"));
    assertEquals("Greet from HelloWorldClinit 2", runUnguarded(rtype.getClazz(), "greet").stdout);
  }

  @Test
  public void rewriteWithReturnValues() throws Exception {
View Full Code Here

    ReloadableType rtype = typeRegistry.addType("data.HelloWorld", loadBytesForClass("data.HelloWorld"));

    Result r = runUnguarded(rtype.getClazz(), "getValue");
    assertEquals("message from HelloWorld", r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValue");
    assertEquals("message from HelloWorld", r.returnValue);
  }

  @Test
View Full Code Here

    Result r = runUnguarded(rtype.getClazz(), "getValue");
    assertTrue(r.returnValue instanceof Integer);
    assertEquals(42, r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValue");
    assertTrue(r.returnValue instanceof Integer);
    assertEquals(42, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
View Full Code Here

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValue");
    assertTrue(r.returnValue instanceof Integer);
    assertEquals(42, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
    r = runUnguarded(rtype.getClazz(), "getValue");
    assertTrue(r.returnValue instanceof Integer);
    assertEquals(37, r.returnValue);
  }
View Full Code Here

    Result r = runUnguarded(rtype.getClazz(), "getValueBoolean");
    assertTrue(r.returnValue instanceof Boolean);
    assertEquals(true, r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueBoolean");
    assertTrue(r.returnValue instanceof Boolean);
    assertEquals(true, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
View Full Code Here

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueBoolean");
    assertTrue(r.returnValue instanceof Boolean);
    assertEquals(true, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
    r = runUnguarded(rtype.getClazz(), "getValueBoolean");
    assertTrue(r.returnValue instanceof Boolean);
    assertEquals(false, r.returnValue);
  }
View Full Code Here

    Result r = runUnguarded(rtype.getClazz(), "getValueShort");
    assertTrue(r.returnValue instanceof Short);
    assertEquals((short) 3, r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueShort");
    assertTrue(r.returnValue instanceof Short);
    assertEquals((short) 3, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
View Full Code Here

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueShort");
    assertTrue(r.returnValue instanceof Short);
    assertEquals((short) 3, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
    r = runUnguarded(rtype.getClazz(), "getValueShort");
    assertTrue(r.returnValue instanceof Short);
    assertEquals((short) 6, r.returnValue);
  }
View Full Code Here

    Result r = runUnguarded(rtype.getClazz(), "getValueLong");
    assertTrue(r.returnValue instanceof Long);
    assertEquals(3L, r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueLong");
    assertTrue(r.returnValue instanceof Long);
    assertEquals(3L, r.returnValue);

    rtype.loadNewVersion("002", retrieveRename("data.HelloWorldPrimitive", "data.HelloWorldPrimitive002"));
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.