Package org.springsource.loaded

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


  public void reloadPrivateVisInner() throws Exception {
    String tclass = "inners.Three";
    TypeRegistry typeRegistry = getTypeRegistry("inners..*");
   
   
    ReloadableType rtype = typeRegistry.addType(tclass, loadBytesForClass(tclass));
    runUnguarded(rtype.getClazz(), "runner");

//    ReloadableType rtypeInner =
    typeRegistry.addType("inners.Three$Inner", retrieveRename("inners.Three$Inner", "inners.Three2$Inner","inners.Three2:inners.Three"));

View Full Code Here


   
    ReloadableType rtype = typeRegistry.addType(tclass, loadBytesForClass(tclass));
    runUnguarded(rtype.getClazz(), "runner");

//    ReloadableType rtypeInner =
    typeRegistry.addType("inners.Three$Inner", retrieveRename("inners.Three$Inner", "inners.Three2$Inner","inners.Three2:inners.Three"));

    rtype.loadNewVersion("2", retrieveRename(tclass, tclass + "2", "inners.Three2$Inner:inners.Three$Inner","inners.Three2:inners.Three"));
    runUnguarded(rtype.getClazz(), "runner");
  }
View Full Code Here

   */
  @Test
  public void reloadProtectedVisInner() throws Exception {
    String tclass = "inners.Four";
    TypeRegistry typeRegistry = getTypeRegistry("inners..*");
    typeRegistry.addType("inners.Four$Inner", retrieveRename("inners.Four$Inner", "inners.Four2$Inner","inners.Four2:inners.Four"));
    ReloadableType rtype = typeRegistry.addType(tclass, loadBytesForClass(tclass));
    runUnguarded(rtype.getClazz(), "runner");

    rtype.loadNewVersion("2", retrieveRename(tclass, tclass + "2", "inners.Four2$Inner:inners.Four$Inner","inners.Four2:inners.Four"));
    runUnguarded(rtype.getClazz(), "runner");
View Full Code Here

  @Test
  public void reloadProtectedVisInner() throws Exception {
    String tclass = "inners.Four";
    TypeRegistry typeRegistry = getTypeRegistry("inners..*");
    typeRegistry.addType("inners.Four$Inner", retrieveRename("inners.Four$Inner", "inners.Four2$Inner","inners.Four2:inners.Four"));
    ReloadableType rtype = typeRegistry.addType(tclass, loadBytesForClass(tclass));
    runUnguarded(rtype.getClazz(), "runner");

    rtype.loadNewVersion("2", retrieveRename(tclass, tclass + "2", "inners.Four2$Inner:inners.Four$Inner","inners.Four2:inners.Four"));
    runUnguarded(rtype.getClazz(), "runner");
  }
View Full Code Here

   */
  @Test
  public void basicExternals() throws Exception {
    String t = "executor.TestOne";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    reload(rtype, "37");
    Class<?> clazz = rtype.getLatestExecutorClass();
    Assert.assertEquals(Utils.getExecutorName(t, "37"), clazz.getName());
    Assert.assertEquals(3, clazz.getDeclaredMethods().length);
    Assert.assertEquals(1, clazz.getDeclaredFields().length);
View Full Code Here

   */
  @Test
  public void basicInternalsLocalVariables() throws Exception {
    String t = "executor.TestOne";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    reload(rtype, "37");
    checkLocalVariables(rtype.getLatestExecutorBytes(), "foo(Lexecutor/TestOne;Ljava/lang/String;)J",
        "thiz:Lexecutor/TestOne;", "s:Ljava/lang/String;");
  }

View Full Code Here

  public void codeStructure() throws Exception {
    String tclass = "executor.TestOne";

    TypeRegistry typeRegistry = getTypeRegistry(tclass);

    ReloadableType rtype = typeRegistry.addType(tclass, loadBytesForClass(tclass));

    // Reload it (triggers creation of dispatcher/executor)
    rtype.loadNewVersion("2", rtype.bytesInitial);

    // @formatter:off
View Full Code Here

  @Test
  public void secondVersion() throws Exception {
    String tclass = "executor.TestOne";
    TypeRegistry typeRegistry = getTypeRegistry(tclass);

    ReloadableType rtype = typeRegistry.addType(tclass, loadBytesForClass(tclass));

    rtype.loadNewVersion("2", retrieveRename(tclass, tclass + "2"));

    // testing executor is for second version and not first
View Full Code Here

   */
  @Test
  public void typeLevelAnnotations() {
    String t = "executor.A";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    reload(rtype, "2");
    Class<?> clazz = rtype.getLatestExecutorClass();
    Assert.assertEquals(Utils.getExecutorName(t, "2"), clazz.getName());
    Annotation[] annos = clazz.getAnnotations();
    Assert.assertNotNull(annos);
View Full Code Here

   */
  @Test
  public void typeLevelAnnotations2() {
    String t = "executor.A";
    TypeRegistry typeRegistry = getTypeRegistry(t);
    ReloadableType rtype = typeRegistry.addType(t, loadBytesForClass(t));
    rtype.loadNewVersion("2", retrieveRename(t, t + "2"));
    Class<?> clazz = rtype.getLatestExecutorClass();
    Assert.assertEquals(Utils.getExecutorName(t, "2"), clazz.getName());
    Annotation[] annos = clazz.getAnnotations();
    Assert.assertNotNull(annos);
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.