/** * @since 4.13 */ protected void invokeMethod(FrameworkMethod method) throws Throwable { method.invokeExplosively(target); } }
/** * @since 4.13 */ protected void invokeMethod(FrameworkMethod method) throws Throwable { method.invokeExplosively(target); } }
@Override public void evaluate() throws Throwable { testMethod.invokeExplosively(target); } }
@Override public void evaluate() throws Throwable { fTestMethod.invokeExplosively(fTarget); } }
@Override public Object invokeExplosively(Object target, Object... params) throws Throwable { return super.invokeExplosively(target, parameters); }
@Override public Object invokeExplosively(Object target, Object... params) throws Throwable { return delegatee.invokeExplosively( target, params ); }
@Override protected void invokeMethod(FrameworkMethod method) throws Throwable { int paramCount = method.getMethod().getParameterTypes().length; method.invokeExplosively(null, paramCount == 0 ? (Object[]) null : parameters); } }
@Override protected void invokeMethod(FrameworkMethod method) throws Throwable { int paramCount = method.getMethod().getParameterTypes().length; method.invokeExplosively(null, paramCount == 0 ? (Object[]) null : parameters); } }
@Override public void evaluate() throws Throwable { for (FrameworkMethod before : fBefores) { before.invokeExplosively(fTarget); } fNext.evaluate(); } }
@Override public void evaluate() throws Throwable { try { final Object[] values = complete.getMethodArguments( nullsOk()); method.invokeExplosively(freshInstance, values); } catch (CouldNotGenerateValueException e) { // ignore } } };
@SuppressWarnings("unchecked") private static List<Object[]> getParametersList(TestClass testClass, ClassLoader classLoader) throws Throwable { return (List<Object[]>) getParametersMethod(testClass, classLoader).invokeExplosively(null); }
@Override public Object getValue() throws CouldNotGenerateValueException { try { return fMethod.invokeExplosively(null); } catch (IllegalArgumentException e) { throw new RuntimeException( "unexpected: argument length is checked"); } catch (IllegalAccessException e) { throw new RuntimeException( "unexpected: getMethods returned an inaccessible method"); } catch (Throwable e) { throw new CouldNotGenerateValueException(); // do nothing, just look for more values } }
private void invokeBeforeClass(final Class clazz) throws Throwable { if (!loadedTestClasses.contains(clazz)) { loadedTestClasses.add(clazz); final TestClass testClass = new TestClass(clazz); final List<FrameworkMethod> befores = testClass.getAnnotatedMethods(BeforeClass.class); for (FrameworkMethod before : befores) { before.invokeExplosively(null); } } }
@Override public void evaluate() throws Throwable { final Object[] values = complete.getMethodArguments(); if (!nullsOk()) { Assume.assumeNotNull(values); } method.invokeExplosively(freshInstance, values); } };
@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 static void invokeAfterClass(final Class<?> clazz) throws Throwable { final TestClass testClass = new TestClass(clazz); final List<FrameworkMethod> afters = testClass.getAnnotatedMethods(AfterClass.class); for (FrameworkMethod after : afters) { after.invokeExplosively(null); } }
@Override public Object getValue() throws CouldNotGenerateValueException { try { return method.invokeExplosively(null); } catch (IllegalArgumentException e) { throw new RuntimeException( "unexpected: argument length is checked"); } catch (IllegalAccessException e) { throw new RuntimeException( "unexpected: getMethods returned an inaccessible method"); } catch (Throwable throwable) { DataPoint annotation = method.getAnnotation(DataPoint.class); Assume.assumeTrue(annotation == null || !isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)); throw new CouldNotGenerateValueException(throwable); } }
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) { for (FrameworkMethod dataPointsMethod : fClass .getAnnotatedMethods(DataPoints.class)) { try { addMultiPointArrayValues(sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable e) { // ignore and move on } } }
@SuppressWarnings("unchecked") private List<Object[]> getParametersList(TestClass klass) throws Throwable { return (List<Object[]>) getParametersMethod( klass ).invokeExplosively( null ); }
@Override public void evaluate() throws Throwable { // 1.invoke the method DexClassNode clzNode = new DexClassNode(DexConstants.ACC_PUBLIC, "La;", "Ljava/lang/Object;", null); if (method.isStatic()) { method.invokeExplosively(null, clzNode); } else { method.invokeExplosively(test, clzNode); } // 2. convert and verify TestUtils.translateAndCheck(clzNode); } };