Package org.jmock.core.constraint

Examples of org.jmock.core.constraint.IsEqual


    public MockObjectSupportTestCase( String name ) {
        super(name);
    }

    public IsEqual eq( Object operand ) {
        return new IsEqual(operand);
    }
View Full Code Here


*/
public class CreateSessionInterceptorTest extends StrutsTestCase {

    public void testCreateSession() throws Exception {
        Mock httpServletRequestMock = new Mock(HttpServletRequest.class);
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.TRUE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        HttpServletRequest request = (HttpServletRequest) httpServletRequestMock.proxy();

        ServletActionContext.setRequest(request);

        CreateSessionInterceptor interceptor = new CreateSessionInterceptor();
View Full Code Here

    public MockObjectSupportTestCase( String name ) {
        super(name);
    }

    public IsEqual eq( Object operand ) {
        return new IsEqual(operand);
    }
View Full Code Here

        portletSizesParamMock = new Mock(InitParam.class);
        portletSizesParam = (InitParam) portletSizesParamMock.proxy();

        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletSizesParamMock, "getParamValue", "33%,66%");
        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletRegistryMock, "getPortletDefinitionByUniqueName",new Constraint[] {new IsEqual("layout")}, portletDef);
        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletRegistryMock, "getPortletDefinitionByUniqueName",new Constraint[] {new IsEqual("layout"), new IsInstanceOf(Boolean.class)}, portletDef);
        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletDefMock, "getInitParam", new Constraint[] {new IsEqual("sizes")}, portletSizesParam);
       
        return portletRegistry;
    }
View Full Code Here

        portletSizesParamMock = new Mock(InitParam.class);
        portletSizesParam = (InitParam) portletSizesParamMock.proxy();

        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletSizesParamMock, "getParamValue", "33%,66%");
        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletRegistryMock, "getPortletDefinitionByUniqueName", portletDef);
        expectAndReturn(new InvokeAtLeastOnceMatcher(), portletDefMock, "getInitParam", new Constraint[] {new IsEqual("sizes")}, portletSizesParam);
       
        return portletRegistry;
    }
View Full Code Here

TOP

Related Classes of org.jmock.core.constraint.IsEqual

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.