Package org.springsource.loaded

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


    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);

    // Should be nothing defined in the child loader
View Full Code Here


    String two = "basic.BasicB";
    String three = "basic.BasicC";

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

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

    result = runUnguarded(tOne.getClazz(), "getValue");
    assertEquals(5, result.returnValue);
View Full Code Here

    String three = "basic.BasicC";

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

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

    result = runUnguarded(tOne.getClazz(), "getValue");
    assertEquals(5, result.returnValue);
View Full Code Here

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

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

    result = runUnguarded(tOne.getClazz(), "getValue");
    assertEquals(5, result.returnValue);

    // Should be nothing defined in the child loader
View Full Code Here

  public void fields() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String a = "simple.Front";
    String b = "simple.Back";
    TypeRegistry r = getTypeRegistry(a + "," + b);
    ReloadableType rtypea = r.addType(a, loadBytesForClass(a));
    ReloadableType rtypeb = r.addType(b, loadBytesForClass(b));
    result = runUnguarded(rtypea.getClazz(), "run");
    assertEquals(35, result.returnValue);

    try {
View Full Code Here

    binLoader = new TestClassloaderWithRewriting();
    String a = "simple.Front";
    String b = "simple.Back";
    TypeRegistry r = getTypeRegistry(a + "," + b);
    ReloadableType rtypea = r.addType(a, loadBytesForClass(a));
    ReloadableType rtypeb = r.addType(b, loadBytesForClass(b));
    result = runUnguarded(rtypea.getClazz(), "run");
    assertEquals(35, result.returnValue);

    try {
      result = runUnguarded(rtypea.getClazz(), "run2");
View Full Code Here

  @Test
  public void reflection() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String a = "simple.SelfReflector";
    TypeRegistry r = getTypeRegistry(a);
    ReloadableType rtypea = r.addType(a, loadBytesForClass(a));
    result = runUnguarded(rtypea.getClazz(), "run");

    assertEquals(
        "14 $callSiteArray $class$java$lang$String $class$java$lang$StringBuilder $class$java$lang$reflect$Field $class$java$util$ArrayList $class$java$util$Collections $class$java$util$Iterator $class$java$util$List $class$simple$SelfReflector $staticClassInfo __$stMC array$$class$java$lang$reflect$Field i metaClass",
        result.returnValue);
View Full Code Here

  @Test
  public void localVariables() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String a = "simple.LFront";
    TypeRegistry r = getTypeRegistry(a);
    ReloadableType rtypea = r.addType(a, loadBytesForClass(a));
    result = runUnguarded(rtypea.getClazz(), "run");
    assertEquals("abc", result.returnValue);
    result = runUnguarded(rtypea.getClazz(), "run2");
    assertEquals(99, result.returnValue);
View Full Code Here

  public void fieldsOnInstance() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String a = "simple.Front";
    String b = "simple.Back";
    TypeRegistry r = getTypeRegistry(a + "," + b);
    ReloadableType rtypea = r.addType(a, loadBytesForClass(a));
    ReloadableType rtypeb = r.addType(b, loadBytesForClass(b));
    Object instance = rtypea.getClazz().newInstance();
    result = runOnInstance(rtypea.getClazz(), instance, "run");
    assertEquals(35, result.returnValue);
    try {
View Full Code Here

    binLoader = new TestClassloaderWithRewriting();
    String a = "simple.Front";
    String b = "simple.Back";
    TypeRegistry r = getTypeRegistry(a + "," + b);
    ReloadableType rtypea = r.addType(a, loadBytesForClass(a));
    ReloadableType rtypeb = r.addType(b, loadBytesForClass(b));
    Object instance = rtypea.getClazz().newInstance();
    result = runOnInstance(rtypea.getClazz(), instance, "run");
    assertEquals(35, result.returnValue);
    try {
      result = runOnInstance(rtypea.getClazz(), instance, "run2");
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.