@Override public MethodExecutionResult findAndInvoke(String methodName, Object instance, Object... args) throws Throwable { Method method = findMatchingMethod(methodName, instance, args); if (method != null) { return this.invokeMethod(instance, method, args); } return MethodExecutionResult.noMethod(methodName, instance.getClass(), args.length); }
@Override public MethodExecutionResult findAndInvoke(String methodName, Object instance, Object... args) throws Throwable { Method method = findMatchingMethod(methodName, instance, args); if (method != null) { return this.invokeMethod(instance, method, args); } return MethodExecutionResult.noMethod(methodName, instance.getClass(), args.length); }
private MethodExecutionResult findSystemUnderTest(String methodName, Object instance, Class<?> k, Object[] args) throws Throwable{ Field[] fields = k.getDeclaredFields(); for (Field field : fields) { if (isSystemUnderTest(field)) { Object systemUnderTest = field.get(instance); MethodExecutionResult res = findAndInvoke(methodName, args, systemUnderTest); if (res.hasResult()) { return res; } } } return MethodExecutionResult.noMethod(methodName, instance.getClass(), args.length); }
private MethodExecutionResult findSystemUnderTest(String methodName, Object instance, Class<?> k, Object[] args) throws Throwable{ Field[] fields = k.getDeclaredFields(); for (Field field : fields) { if (isSystemUnderTest(field)) { Object systemUnderTest = field.get(instance); MethodExecutionResult res = findAndInvoke(methodName, args, systemUnderTest); if (res.hasResult()) { return res; } } } return MethodExecutionResult.noMethod(methodName, instance.getClass(), args.length); }