Package org.springsource.loaded

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


  @Test
  public void methodLevelAnnotations() throws Exception {
    String t = "executor.B";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    reload(rtype, "37");
    checkAnnotations(rtype.bytesLoaded, "m()V", "@common.Marker()");
    checkAnnotations(rtype.bytesLoaded, "m2()V");
    checkAnnotations(rtype.getLatestExecutorBytes(), "m(Lexecutor/B;)V", "@common.Marker()");
    checkAnnotations(rtype.getLatestExecutorBytes(), "m2(Lexecutor/B;)V");
View Full Code Here


  @Test
  public void methodLevelAnnotationsOnInterfaces() throws Exception {
    String t = "executor.I";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    reload(rtype, "37");
    checkAnnotations(rtype.bytesLoaded, "m()V", "@common.Marker()");
    checkAnnotations(rtype.bytesLoaded, "m2()V");
    checkAnnotations(rtype.getLatestExecutorBytes(), "m(Lexecutor/I;)V", "@common.Marker()");
    checkAnnotations(rtype.getLatestExecutorBytes(), "m2(Lexecutor/I;)V");
View Full Code Here

  @Test
  public void methodLevelAnnotationsOnInterfaces2() throws Exception {
    String t = "reflection.methodannotations.InterfaceTarget";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    checkAnnotations(rtype.bytesLoaded, "privMethod()V", "@reflection.AnnoT3(value=Foo)");
    reload(rtype, "37");
    checkAnnotations(rtype.getLatestExecutorBytes(), "privMethod(Lreflection/methodannotations/InterfaceTarget;)V",
        "@reflection.AnnoT3(value=Foo)");
    rtype.loadNewVersion("39", retrieveRename(t, t + "002"));
View Full Code Here

  @Test
  public void clashingInstanceStaticMethods() throws Exception {
    String t = "executor.C";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    reload(rtype, "37");
  }

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

  @Test
  public void staticInitializerReloading1() throws Exception {
    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");
View Full Code Here

  @Test
  public void staticInitializerReloading2() throws Exception {
    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
View Full Code Here

   */
  @Test
  public void staticInitializerReloading3() throws Exception {
    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");
View Full Code Here

   */
  @Test
  public void staticInitializerReloading4() throws Exception {
    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");
View Full Code Here

  @Test
  public void loadType2() {
    TypeRegistry typeRegistry = getTypeRegistry("data.SimpleClass");
    assertTrue(typeRegistry.isReloadableTypeName("data/SimpleClass"));
    byte[] dsc = loadBytesForClass("data.SimpleClass");
    ReloadableType rtype = typeRegistry.addType("data.SimpleClass", dsc);
    assertNotNull(rtype);
  }

  @Test
  public void rebasePaths() {
View Full Code Here

    GlobalConfiguration.maxClassDefinitions = 4;

    TypeRegistry typeRegistry = getTypeRegistry(one + "," + two);

    ReloadableType tOne = typeRegistry.addType(one, loadBytesForClass(one));
    ReloadableType tTwo = typeRegistry.addType(two, loadBytesForClass(two));

    result = runUnguarded(tOne.getClazz(), "getValue");
    assertEquals(5, 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.