/** * Invoke a private or inner class method in that is located in a subclass * of the instance. This might be useful to test private methods. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object instance, Class<?> declaringClass, String methodToExecute, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(instance, declaringClass, methodToExecute, arguments); }
/** * Invoke a private or inner class static method without the need to specify * the method name. This is thus a more refactor friendly version of the * {@link #invokeMethod(Class, String, Object...)} method and is recommend * over this method for that reason. This method might be useful to test * private methods. * */ public static synchronized <T> T invokeMethod(Class<?> klass, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(klass, arguments); }
/** * Invoke a private or inner class method in cases where PowerMock cannot * automatically determine the type of the parameters, for example when * mixing primitive types and wrapper types in the same method. For most * situations use {@link #invokeMethod(Object, Object...)} instead. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object instance, String methodToExecute, Class<?>[] argumentTypes, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(instance, methodToExecute, argumentTypes, arguments); }
/** * Invoke a private or inner class method in that is located in a subclass * of the instance. This might be useful to test private methods. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object instance, Class<?> declaringClass, String methodToExecute, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(instance, declaringClass, methodToExecute, arguments); }
/** * Invoke a static private or inner class method. This may be useful to test * private methods. * */ public static synchronized <T> T invokeMethod(Class<?> clazz, String methodToExecute, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(clazz, methodToExecute, arguments); }
/** * Invoke a private or inner class method in that is located in a subclass * of the instance. This might be useful to test private methods. * <p> * Use this for overloaded methods. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object object, Class<?> declaringClass, String methodToExecute, Class<?>[] parameterTypes, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(object, declaringClass, methodToExecute, parameterTypes, arguments); }
/** * Invoke a private or inner class method without the need to specify the * method name. This is thus a more refactor friendly version of the * {@link #invokeMethod(Object, String, Object...)} method and is recommend * over this method for that reason. This method might be useful to test * private methods. * * @throws Throwable */ public static synchronized <T> T invokeMethod(Object instance, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(instance, arguments); }
/** * Invoke a static private or inner class method. This may be useful to test * private methods. * */ public static synchronized <T> T invokeMethod(Class<?> clazz, String methodToExecute, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(clazz, methodToExecute, arguments); }
/** * Invoke a private or inner class method in a subclass (defined by * <code>definedIn</code>) in cases where PowerMock cannot automatically * determine the type of the parameters, for example when mixing primitive * types and wrapper types in the same method. For most situations use * {@link #invokeMethod(Object, Object...)} instead. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object instance, String methodToExecute, Class<?> definedIn, Class<?>[] argumentTypes, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(instance, methodToExecute, definedIn, argumentTypes, arguments); }
/** * Invoke a private or inner class method without the need to specify the * method name. This is thus a more refactor friendly version of the * {@link #invokeMethod(Object, String, Object...)} method and is recommend * over this method for that reason. This method might be useful to test * private methods. * * @throws Exception if something wrong. */ public static synchronized <T> T invokeMethod(Object instance, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(instance, arguments); }
/** * Invoke a private or inner class static method without the need to specify * the method name. This is thus a more refactor friendly version of the * {@link #invokeMethod(Class, String, Object...)} method and is recommend * over this method for that reason. This method might be useful to test * private methods. * */ public static synchronized <T> T invokeMethod(Class<?> klass, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(klass, arguments); }
/** * Invoke a private or inner class method. This might be useful to test * private methods. */ public static synchronized <T> T invokeMethod(Object instance, String methodToExecute, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(instance, methodToExecute, arguments); }
/** * Invoke a private or inner class method. This might be useful to test * private methods. */ public static synchronized <T> T invokeMethod(Object instance, String methodToExecute, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(instance, methodToExecute, arguments); }
/** * Invoke a private or inner class method in that is located in a subclass * of the instance. This might be useful to test private methods. * <p> * Use this for overloaded methods. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object object, Class<?> declaringClass, String methodToExecute, Class<?>[] parameterTypes, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(object, declaringClass, methodToExecute, parameterTypes, arguments); }
/** * Invoke a private or inner class method in cases where PowerMock cannot * automatically determine the type of the parameters, for example when * mixing primitive types and wrapper types in the same method. For most * situations use {@link #invokeMethod(Object, Object...)} instead. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object instance, String methodToExecute, Class<?>[] argumentTypes, Object... arguments) throws Exception { return WhiteboxImpl.<T> invokeMethod(instance, methodToExecute, argumentTypes, arguments); }
/** * Invoke a private or inner class method in a subclass (defined by * {@code definedIn}) in cases where PowerMock cannot automatically * determine the type of the parameters, for example when mixing primitive * types and wrapper types in the same method. For most situations use * {@link #invokeMethod(Object, Object...)} instead. * * @throws Exception * Exception that may occur when invoking this method. */ public static synchronized <T> T invokeMethod(Object instance, String methodToExecute, Class<?> definedIn, Class<?>[] argumentTypes, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(instance, methodToExecute, definedIn, argumentTypes, arguments); }