Examples of NiceMockStrategy


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

     */
    public static <T> T createNicePartialMock(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 NiceMockStrategy(), new String[] { methodName }, constructorArgs,
                methodParameterTypes);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.