Package org.springsource.loaded.test.infra

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


  @Test
  public void test_GetMethodWithBridgeMethods() throws Exception {
    registry = getTypeRegistry("reflection.bridgemethods..*");
    ReloadableType targetClass = reloadableClass("reflection.bridgemethods.ClassWithBridgeMethod");

    Result r = getDeclaredMethod(targetClass.getClazz(), "clone");
    assertMethod("protected java.lang.Object reflection.bridgemethods.ClassWithBridgeMethod.clone()"
        + " throws java.lang.CloneNotSupportedException", r); // In the first version of the class, there's only one method and it returns object

    reloadType(targetClass, "002");
    r = getDeclaredMethod(targetClass.getClazz(), "clone");
View Full Code Here


  public void testGetMethod() throws Exception {
    String subClassName = TARGET_PACKAGE + ".SubClassTarget";
    ReloadableType subClass = reloadableClass(subClassName);

    //Try getting and calling method that is declared in this class
    Result r = getMethod(subClass.getClazz(), "subMethod");
    Method m = assertMethod("public java.lang.String " + subClassName + ".subMethod()", r);

    Object instance = subClass.getClazz().newInstance();
    r = invokeOn(instance, m);
    assertEquals("SubClassTarget.subMethod", r.returnValue);
View Full Code Here

  }

  @Override
  public Result test() throws ResultException, Exception {
    try {
      Result r = runOnInstance(callerClazz, callerInstance, testedMethodCaller, field);
      Assert.assertTrue(r.returnValue instanceof List<?>);
      return r;
    } catch (ResultException e) {
      throw new Error(e);
    }
View Full Code Here

    callerInstance = newInstance(callerClazz);
  }

  @Override
  public Result test() throws ResultException, Exception {
    Result r = runOnInstance(callerClazz, callerInstance, testedMethodCaller, member);
    return r;
  }
View Full Code Here

  }

  @Override
  public Result test() throws ResultException, Exception {
    try {
      Result r = runOnInstance(callerClazz, callerInstance, testedMethodCaller, method);
      Assert.assertTrue(r.returnValue instanceof List<?>);
      return r;
    } catch (ResultException e) {
      throw new Error(e);
    }
View Full Code Here

  }

  @Override
  public Result test() throws ResultException, Exception {
    try {
      Result r = runOnInstance(callerClazz, callerInstance, testedMethodCaller, method);
      Assert.assertTrue(r.returnValue instanceof List<?>);
      return r;
    } catch (ResultException e) {
      throw new Error(e);
    }
View Full Code Here

  }

  @Override
  public Result test() throws ResultException, Exception {
    method.setAccessible(true);
    Result r = runOnInstance(callerClazz, callerInstance, "callInvoke", method, targetInstance, new Object[0]);
    return r;
  }
View Full Code Here

    return methodSignatureCache;
  }

  @Override
  public Result test() throws ResultException, Exception {
    Result r = runOnInstance(callerClazz, callerInstance, "callGetMethod", targetClass, methodName, params);
    Assert.assertTrue(r.returnValue instanceof Method);
    r.returnValue = r.returnValue.toString(); // Method objects will not be 'equals' if loaded by different classloaders
    return r;
  }
View Full Code Here

  }

  @Override
  public Result test() throws ResultException, Exception {
    try {
      Result r = runOnInstance(callerClazz, callerInstance, targetMethodName, targetClass);
      return r;
    } catch (ResultException e) {
      throw new Error(e);
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public Result test() throws ResultException, Exception {
    try {
      Result r = runOnInstance(callerClazz, callerInstance, targetMethodName, targetClass);
      collectFieldNames((List<Field>) r.returnValue);
      return r;
    } catch (ResultException e) {
      throw new Error(e);
    }
View Full Code Here

TOP

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

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.