Package org.springsource.loaded

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


  public void closure4_oneReference() throws Exception {
    String t = "simple.BasicWithClosureD";
    String c = "simple.BasicWithClosureD$_run_closure1";
    String c2 = "simple.BasicWithClosureD$_run_closure1_closure2";
    TypeRegistry r = getTypeRegistry(t + "," + c + "," + c2);
    ReloadableType ctype = r.addType(c, loadBytesForClass(c));
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("foo() running\nstring is abc\nowner is not null", result.stdout);

    rtype.loadNewVersion(
View Full Code Here


    String t = "simple.BasicWithClosureD";
    String c = "simple.BasicWithClosureD$_run_closure1";
    String c2 = "simple.BasicWithClosureD$_run_closure1_closure2";
    TypeRegistry r = getTypeRegistry(t + "," + c + "," + c2);
    ReloadableType ctype = r.addType(c, loadBytesForClass(c));
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("foo() running\nstring is abc\nowner is not null", result.stdout);

    rtype.loadNewVersion(
        "2",
View Full Code Here

  @Test
  public void closure5_multipleReferences() throws Exception {
    String t = "simple.BasicWithClosureE";
    String c = "simple.BasicWithClosureE$_run_closure1";
    TypeRegistry r = getTypeRegistry(t + "," + c);
    ReloadableType ctype = r.addType(c, loadBytesForClass(c));
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("foo() running\nstring is abc\nowner is not null", result.stdout);

    rtype.loadNewVersion(
View Full Code Here

  public void closure5_multipleReferences() throws Exception {
    String t = "simple.BasicWithClosureE";
    String c = "simple.BasicWithClosureE$_run_closure1";
    TypeRegistry r = getTypeRegistry(t + "," + c);
    ReloadableType ctype = r.addType(c, loadBytesForClass(c));
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("foo() running\nstring is abc\nowner is not null", result.stdout);

    rtype.loadNewVersion(
        "2",
View Full Code Here

  @Test
  public void testControllers1() throws Exception {
    String t = "controller.Controller";
    String closure = "controller.Controller$_closure1";
    TypeRegistry r = getTypeRegistry(t + "," + closure);
    ReloadableType ttype = r.addType(t, loadBytesForClass(t));
    ReloadableType closuretype = r.addType(closure, loadBytesForClass(closure));

    result = runUnguarded(ttype.getClazz(), "execute");
    assertEquals("[action:list, params:2]", result.stdout);
View Full Code Here

  public void testControllers1() throws Exception {
    String t = "controller.Controller";
    String closure = "controller.Controller$_closure1";
    TypeRegistry r = getTypeRegistry(t + "," + closure);
    ReloadableType ttype = r.addType(t, loadBytesForClass(t));
    ReloadableType closuretype = r.addType(closure, loadBytesForClass(closure));

    result = runUnguarded(ttype.getClazz(), "execute");
    assertEquals("[action:list, params:2]", result.stdout);

    // Change the body of the 'index' closure
View Full Code Here

  @Test
  public void staticInitializerReloading1() throws Exception {
    String t = "clinitg.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 = "clinitg.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

  @Ignore
  @Test
  public void staticInitializerReloading3() throws Exception {
    String t = "clinitg.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

    String enumtype = "enums.WhatAnEnum";
    String intface = "enums.ExtensibleEnum";
    String runner = "enums.RunnerA";
    TypeRegistry typeRegistry = getTypeRegistry(enumtype + "," + intface + "," + runner);
//    ReloadableType rtypeIntface =
    typeRegistry.addType(intface, loadBytesForClass(intface));
    ReloadableType rtypeEnum = typeRegistry.addType(enumtype, loadBytesForClass(enumtype));
    ReloadableType rtypeRunner = typeRegistry.addType(runner, loadBytesForClass(runner));
    result = runUnguarded(rtypeRunner.getClazz(), "run");
    // ClassPrinter.print(rtypeEnum.bytesInitial);
    assertContains("[RED GREEN BLUE]", result.stdout);
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.