public MethodMatcherException(final String message, final Method method, final Object[] args) { this(generateMessage(message, method, args)); }
final Object arg = args[i]; if (arg != null) { sb.append("(").append(arg.getClass().getName()).append(") ").append(stringify(arg)); } else { sb.append("null");
String msg = null; if (injectionMethod instanceof Method) { msg = MethodMatcherException.generateMessage(prefix + "method.", (Method) injectionMethod, queue.backingList.toArray()); } else if (injectionMethod instanceof Constructor) { msg = MethodMatcherException.generateMessage(prefix + "constructor.", (Constructor) injectionMethod, queue.backingList.toArray()); throw new MethodMatcherException(msg); } else { System.err.println(":::WARNING:::\n" + msg);
/** * {@inheritDoc} */ @Override public Object[] getConformingArguments(){ if (getConforms() == null) { conforms(); } if (matchingMatcher != null) { return matchingMatcher.getConformingArguments(); } throw new MethodMatcherException("Data provider mismatch", getContext().getMethod(), getContext().getArguments()); } }
if (injectionMethod instanceof Method) { msg = MethodMatcherException.generateMessage( prefix + "method.", (Method) injectionMethod, queue.backingList.toArray()); } else if (injectionMethod instanceof Constructor) { msg = MethodMatcherException.generateMessage( prefix + "constructor.", (Constructor) injectionMethod, throw new MethodMatcherException(msg); } else { System.err.println(":::WARNING:::\n" + msg);
/** {@inheritDoc} */ @Override public Object[] getConformingArguments() { if (getConforms() == null) { conforms(); } if (matchingMatcher != null) { return matchingMatcher.getConformingArguments(); } throw new MethodMatcherException( "Data provider mismatch", getContext().getMethod(), getContext().getArguments()); } }
public MethodMatcherException(final String message, final Method method, final Object[] args) { this(generateMessage(message, method, args)); }
/** * {@inheritDoc} */ @Override public Object[] getConformingArguments() { if (getConforms() == null) { conforms(); } if (getConformingParameters() == null) { throw new MethodMatcherException(this.getClass().getSimpleName() + " mismatch", getContext().getMethod(), getContext().getArguments()); } return ReflectionRecipes.inject( getContext().getMethodParameter(), InjectableParameter.Assistant.ALL_INJECTS, matchingArguments(getConformingParameters(), getContext().getArguments()), getContext().getMethod(), getContext().getTestContext(), getContext().getTestResult() ); }
final Object arg = args[i]; if (arg != null) { sb.append("(").append(arg.getClass().getName()).append(") ").append(stringify(arg)); } else { sb.append("null");
static String generateMessage(final String message, final Constructor constructor, final Object[] args) { Parameter[] parameter = null; String name = null; if (constructor != null) { parameter = ReflectionRecipes.getConstructorParameters(constructor); name = constructor.getName(); } return generateMessage(message, name, "Constructor", parameter, args); }
/** {@inheritDoc} */ @Override public Object[] getConformingArguments() { if (getConforms() == null) { conforms(); } if (getConformingParameters() == null) { throw new MethodMatcherException( this.getClass().getSimpleName() + " mismatch", getContext().getMethod(), getContext().getArguments()); } return ReflectionRecipes.inject( getContext().getMethodParameter(), InjectableParameter.Assistant.ALL_INJECTS, matchingArguments(getConformingParameters(), getContext().getArguments()), getContext().getMethod(), getContext().getTestContext(), getContext().getTestResult()); }
public static String generateMessage(final String message, final Method method, final Object[] args) { Parameter[] parameter = null; String name = null; if (method != null) { parameter = ReflectionRecipes.getMethodParameters(method); name = method.getName(); } return generateMessage(message, name, "Method", parameter, args); }
static String generateMessage( final String message, final Constructor constructor, final Object[] args) { Parameter[] parameter = null; String name = null; if (constructor != null) { parameter = ReflectionRecipes.getConstructorParameters(constructor); name = constructor.getName(); } return generateMessage(message, name, "Constructor", parameter, args); }
public static String generateMessage( final String message, final Method method, final Object[] args) { Parameter[] parameter = null; String name = null; if (method != null) { parameter = ReflectionRecipes.getMethodParameters(method); name = method.getName(); } return generateMessage(message, name, "Method", parameter, args); }