private Exception parametersMethodReturnedWrongType() throws Exception { String className = getTestClass().getName(); String methodName = getParametersMethod().getName(); String message = MessageFormat.format( "{0}.{1}() must return an Iterable of arrays.", className, methodName); return new Exception(message); }
@SuppressWarnings("unchecked") private Iterable<Object[]> allParameters() throws Throwable { Object parameters = getParametersMethod().invokeExplosively(null); if (parameters instanceof Iterable) { return (Iterable<Object[]>) parameters; } else { throw parametersMethodReturnedWrongType(); } }
/** * Only called reflectively. Do not use programmatically. */ public Parameterized(Class<?> klass) throws Throwable { super(klass, NO_RUNNERS); Parameters parameters = getParametersMethod().getAnnotation( Parameters.class); createRunnersForParameters(allParameters(), parameters.name()); }
@SuppressWarnings("unchecked") private Iterable<Object[]> allParameters() throws Throwable { Object parameters = getParametersMethod().invokeExplosively(null); if (parameters instanceof Iterable) { return (Iterable<Object[]>) parameters; } else { throw parametersMethodReturnedWrongType(); } }
private Exception parametersMethodReturnedWrongType() throws Exception { String className = getTestClass().getName(); String methodName = getParametersMethod().getName(); String message = MessageFormat.format( "{0}.{1}() must return an Iterable of arrays.", className, methodName); return new Exception(message); }
/** * Only called reflectively. Do not use programmatically. */ public Parameterized(Class<?> klass) throws Throwable { super(klass, NO_RUNNERS); Parameters parameters = getParametersMethod().getAnnotation( Parameters.class); createRunnersForParameters(allParameters(), parameters.name()); }
@SuppressWarnings("unchecked") private Iterable<Object> allParameters() throws Throwable { Object parameters = getParametersMethod().invokeExplosively(null); if (parameters instanceof Iterable) { return (Iterable<Object>) parameters; } else if (parameters instanceof Object[]) { return Arrays.asList((Object[]) parameters); } else { throw parametersMethodReturnedWrongType(); } }
@SuppressWarnings("unchecked") private Iterable<Object> allParameters() throws Throwable { Object parameters = getParametersMethod().invokeExplosively(null); if (parameters instanceof Iterable) { return (Iterable<Object>) parameters; } else if (parameters instanceof Object[]) { return Arrays.asList((Object[]) parameters); } else { throw parametersMethodReturnedWrongType(); } }
private Exception parametersMethodReturnedWrongType() throws Exception { String className = getTestClass().getName(); String methodName = getParametersMethod().getName(); String message = MessageFormat.format( "{0}.{1}() must return an Iterable of arrays.", className, methodName); return new Exception(message); }
@SuppressWarnings("unchecked") private Iterable<Object[]> allParameters() throws Throwable { Object parameters = getParametersMethod().invokeExplosively(null); if (parameters instanceof Iterable) { return (Iterable<Object[]>) parameters; } else { throw parametersMethodReturnedWrongType(); } }
@SuppressWarnings("unchecked") private Iterable<Object[]> allParameters() throws Throwable { Object parameters = getParametersMethod().invokeExplosively(null); if (parameters instanceof Iterable) { return (Iterable<Object[]>) parameters; } else { throw parametersMethodReturnedWrongType(); } }
private Exception parametersMethodReturnedWrongType() throws Exception { String className = getTestClass().getName(); String methodName = getParametersMethod().getName(); String message = MessageFormat.format( "{0}.{1}() must return an Iterable of arrays.", className, methodName); return new Exception(message); }
private Exception parametersMethodReturnedWrongType() throws Exception { String className = getTestClass().getName(); String methodName = getParametersMethod().getName(); String message = MessageFormat.format( "{0}.{1}() must return an Iterable of arrays.", className, methodName); return new Exception(message); }
private Exception parametersMethodReturnedWrongType() throws Exception { String className = getTestClass().getName(); String methodName = getParametersMethod().getName(); String message = MessageFormat.format( "{0}.{1}() must return an Iterable of arrays.", className, methodName); return new Exception(message); }
/** * Only called reflectively. Do not use programmatically. */ public Parameterized(Class<?> klass) throws Throwable { super(klass, NO_RUNNERS); ParametersRunnerFactory runnerFactory = getParametersRunnerFactory( klass); Parameters parameters = getParametersMethod().getAnnotation( Parameters.class); runners = Collections.unmodifiableList(createRunnersForParameters( allParameters(), parameters.name(), runnerFactory)); }
/** * Only called reflectively. Do not use programmatically. */ public Parameterized(Class<?> klass) throws Throwable { super(klass, NO_RUNNERS); ParametersRunnerFactory runnerFactory = getParametersRunnerFactory( klass); Parameters parameters = getParametersMethod().getAnnotation( Parameters.class); runners = Collections.unmodifiableList(createRunnersForParameters( allParameters(), parameters.name(), runnerFactory)); }
/** * Only called reflectively. Do not use programmatically. */ public Parameterized(Class<?> klass) throws Throwable { super(klass, NO_RUNNERS); Parameters parameters = getParametersMethod().getAnnotation( Parameters.class); createRunnersForParameters(allParameters(), parameters.name()); }
/** * Only called reflectively. Do not use programmatically. */ public Parameterized(Class<?> klass) throws Throwable { super(klass, NO_RUNNERS); Parameters parameters = getParametersMethod().getAnnotation( Parameters.class); createRunnersForParameters(allParameters(), parameters.name()); }