Package org.powermock.api.easymock.internal.mockstrategy.impl

Examples of org.powermock.api.easymock.internal.mockstrategy.impl.DefaultMockStrategy


     * @param methods
     *            optionally what methods to mock
     * @return the mock object.
     */
    public static synchronized <T> T createMock(Class<T> type, Method... methods) {
        return doMock(type, false, new DefaultMockStrategy(), null, methods);
    }
View Full Code Here


     * @param type
     *            the type of the mock object
     * @return the mock object.
     */
    public static synchronized <T> T createMock(Class<T> type) {
        return doMock(type, false, new DefaultMockStrategy(), null, (Method[]) null);
    }
View Full Code Here

     * @param methods
     *            optionally what methods to mock
     * @return the mock object.
     */
    public static <T> T createMock(Class<T> type, ConstructorArgs constructorArgs, Method... methods) {
        return doMock(type, false, new DefaultMockStrategy(), constructorArgs, methods);
    }
View Full Code Here

     * @return the mock object.
     */
    public static <T> T createMock(Class<T> type, Object... constructorArguments) {
        Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments);
        ConstructorArgs constructorArgs = new ConstructorArgs(constructor, constructorArguments);
        return doMock(type, false, new DefaultMockStrategy(), constructorArgs, (Method[]) null);
    }
View Full Code Here

     *            the class to enable static mocking
     * @param methods
     *            optionally what methods to mock
     */
    public static synchronized void mockStatic(Class<?> type, Method... methods) {
        doMock(type, true, new DefaultMockStrategy(), null, methods);
    }
View Full Code Here

     *
     * @param type
     *            the class to enable static mocking
     */
    public static synchronized void mockStatic(Class<?> type) {
        doMock(type, true, new DefaultMockStrategy(), null, (Method[]) null);
    }
View Full Code Here

     *            that this is only needed to separate overloaded methods.
     * @return A mock object of type <T>.
     */
    public static synchronized <T> T createPartialMock(Class<T> type, String methodNameToMock,
                                                       Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
        return doMockSpecific(type, new DefaultMockStrategy(), new String[] { methodNameToMock }, null,
                mergeArgumentTypes(firstArgumentType, additionalArgumentTypes));
    }
View Full Code Here

     * @param additionalArgumentTypes
     *            Optional additional argument types.
     */
    public static synchronized void mockStaticPartial(Class<?> clazz, String methodNameToMock,
                                                      Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
        doMockSpecific(clazz, new DefaultMockStrategy(), new String[] { methodNameToMock }, null,
                mergeArgumentTypes(firstArgumentType, additionalArgumentTypes));
    }
View Full Code Here

     * @return the mock object.
     */
    public static <T> T createPartialMock(Class<T> type, String[] methodNames, Object... constructorArguments) {
        Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments);
        ConstructorArgs constructorArgs = new ConstructorArgs(constructor, constructorArguments);
        return doMock(type, false, new DefaultMockStrategy(), constructorArgs, Whitebox.getMethods(type, methodNames));
    }
View Full Code Here

     */
    public static <T> T createPartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
                                          Object... constructorArguments) {
        Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments);
        ConstructorArgs constructorArgs = new ConstructorArgs(constructor, constructorArguments);
        return doMockSpecific(type, new DefaultMockStrategy(), new String[] { methodName }, constructorArgs,
                methodParameterTypes);
    }
View Full Code Here

TOP

Related Classes of org.powermock.api.easymock.internal.mockstrategy.impl.DefaultMockStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.