Package org.powermock.reflect.exceptions

Examples of org.powermock.reflect.exceptions.TooManyMethodsFoundException


      for (Class<?> paramType : parameterTypes) {
        sb.append(paramType.getName()).append(".class ");
      }
      sb.append(")\n");
    }
    throw new TooManyMethodsFoundException(sb.toString());
  }
View Full Code Here


    Method[] methods = Whitebox.getMethods(declaringClass, methodName);
    if (methods.length == 0) {
      throw new MethodNotFoundException(String.format("Couldn't find a method with name %s in the class hierarchy of %s", methodName,
          declaringClass.getName()));
    } else if (methods.length > 1) {
      throw new TooManyMethodsFoundException(String.format("Found %d methods with name %s in the class hierarchy of %s.", methods.length,
          methodName, declaringClass.getName()));
    }

    MockRepository.putMethodProxy(methods[0], invocationHandler);
  }
View Full Code Here

    Method[] methods = Whitebox.getMethods(declaringClass, methodName);
    if (methods.length == 0) {
      throw new MethodNotFoundException(String.format("Couldn't find a method with name %s in the class hierarchy of %s", methodName,
          declaringClass.getName()));
    } else if (methods.length > 1) {
      throw new TooManyMethodsFoundException(String.format("Found %d methods with name %s in the class hierarchy of %s.", methods.length,
          methodName, declaringClass.getName()));
    }

    MockRepository.putMethodToStub(methods[0], returnObject);
  }
View Full Code Here

TOP

Related Classes of org.powermock.reflect.exceptions.TooManyMethodsFoundException

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.