Package org.springsource.loaded.test.infra

Examples of org.springsource.loaded.test.infra.TestClassloaderWithRewriting


  // Accessing a field from another type, which just turns into property
  // access via a method
  @Test
  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));
View Full Code Here


  // test is too sensitive to changes between groovy compiler versions
  @Ignore
  @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");
View Full Code Here

  // TODO why doesn't this need swapInit? Is that only required for static
  // field constants?
  @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);
View Full Code Here

    assertEquals(88, result.returnValue);
  }

  @Test
  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));
View Full Code Here

  }

  // Changing the return value within a method
  @Test
  public void basic() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.Basic";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
View Full Code Here

    assertEquals("goodbye", result.returnValue);
  }

  @Test
  public void basicInstance() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.Basic";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    Object instance = null;
    instance = rtype.getClazz().newInstance();
View Full Code Here

  // The method calls another method to get the return string, test
  // that when the method we are calling changes, we do call the new
  // one (simply checking the callsite cache is reset)
  @Test
  public void basic2() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicB";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
View Full Code Here

  }

  // Similar to BasicB but now using non-static methods
  @Test
  public void basic3() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicC";
    TypeRegistry r = getTypeRegistry(t);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    result = runUnguarded(rtype.getClazz(), "run");
    assertEquals("hello", result.returnValue);
View Full Code Here

  // Now calling between two different types to check if we have
  // to clear more than 'our' state on a reload. In this scenario
  // the method being called is static
  @Test
  public void basic4() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicD";
    String target = "simple.BasicDTarget";
    TypeRegistry r = getTypeRegistry(t + "," + target);
    ReloadableType rtype = r.addType(t, loadBytesForClass(t));
    ReloadableType rtypeTarget = r.addType(target, loadBytesForClass(target));
View Full Code Here

  }

  // Calling from one type to another, now the methods are non-static
  @Test
  public void basic5() throws Exception {
    binLoader = new TestClassloaderWithRewriting();
    String t = "simple.BasicE";
    String target = "simple.BasicETarget";

    TypeRegistry r = getTypeRegistry(t + "," + target);
View Full Code Here

TOP

Related Classes of org.springsource.loaded.test.infra.TestClassloaderWithRewriting

Copyright © 2018 www.massapicom. 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.