Package com.mockobjects.dynamic

Examples of com.mockobjects.dynamic.Mock.expect()


        FullConstraintMatcher matcher = new FullConstraintMatcher(new Constraint[]{C.eq(topic),
            C.eq(durableName), C.IS_NULL, C.IS_TRUE});

        Mock mockSession = new Mock(Session.class);
        mockSession.expect("createDurableSubscriber", matcher);

        jmsSupport.createConsumer((Session)mockSession.proxy(), topic, null, noLocal, durableName, true, getTestInboundEndpoint("test"));

        mockTopic.verify();
        mockSession.verify();
View Full Code Here


        FullConstraintMatcher matcher = new FullConstraintMatcher(new Constraint[]{C.eq(topic), C.IS_NULL,
            C.IS_TRUE});

        Mock mockSession = new Mock(Session.class);
        mockSession.expect("createConsumer", matcher);

        jmsSupport.createConsumer((Session)mockSession.proxy(), topic, null, noLocal, null, true, getTestInboundEndpoint("test"));

        mockTopic.verify();
        mockSession.verify();
View Full Code Here

        boolean noLocal = true;

        FullConstraintMatcher matcher = new FullConstraintMatcher(new Constraint[]{C.eq(queue), C.IS_NULL});

        Mock mockSession = new Mock(Session.class);
        mockSession.expect("createConsumer", matcher);

        jmsSupport.createConsumer((Session)mockSession.proxy(), queue, null, noLocal, null, false, getTestInboundEndpoint("test"));

        mockQueue.verify();
        mockSession.verify();
View Full Code Here

        Connector connector = getConnectorAndAssert();

        // Text exception handler
        Mock ehandlerMock = new Mock(SystemExceptionHandler.class, "exceptionHandler");

        ehandlerMock.expect("handleException", C.isA(Exception.class));

        assertNotNull(muleContext.getExceptionListener());
        muleContext.setExceptionListener((SystemExceptionHandler) ehandlerMock.proxy());
        muleContext.getExceptionListener().handleException(new DefaultMuleException(MessageFactory.createStaticMessage("Dummy")));
View Full Code Here

        muleContext.setExceptionListener((SystemExceptionHandler) ehandlerMock.proxy());
        muleContext.getExceptionListener().handleException(new DefaultMuleException(MessageFactory.createStaticMessage("Dummy")));

        if (connector instanceof AbstractConnector)
        {
            ehandlerMock.expect("handleException", C.isA(Exception.class));
            muleContext.getExceptionListener().handleException(
                    new DefaultMuleException(MessageFactory.createStaticMessage("Dummy")));
        }

        ehandlerMock.verify();
View Full Code Here

    {
        SslConnector connector = new SslConnector(muleContext);
        connector.setSslHandshakeTimeout(1000);
       
        Mock mockService = new Mock(Service.class);
        mockService.expect("getResponseRouter");
        mockService.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());
        Service service = (Service) mockService.proxy();
       
        Map<String, Object> properties = Collections.emptyMap();
View Full Code Here

public class SslMessageReceiverTestCase extends AbstractMessageReceiverTestCase
{
    public MessageReceiver getMessageReceiver() throws Exception
    {
        Mock mockComponent = new Mock(Service.class);
        mockComponent.expect("getResponseRouter");
        mockComponent.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());
        return new SslMessageReceiver(endpoint.getConnector(), (Service) mockComponent.proxy(), endpoint);
    }

    public InboundEndpoint getEndpoint() throws Exception
View Full Code Here

        mockendpoint1.verify();

        event = getTestEvent(new IllegalArgumentException(), (MuleSession) session.proxy());
       
        session.expectAndReturn("getFlowConstruct", getTestService());
        mockendpoint2.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
        messageRouter.process(event);
        mockendpoint2.verify();

        FilteringOutboundRouter router3 = new FilteringOutboundRouter();
        router3.setFilter(new PayloadTypeFilter(Object.class));
View Full Code Here

        event = getTestEvent("testing multiple routing", (MuleSession) session.proxy());
        session.expectAndReturn("getFlowConstruct", getTestService());
        session.expectAndReturn("getFlowConstruct", getTestService());

        mockendpoint1.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
        mockendpoint2.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());

        messageRouter.setMatchAll(true);
        messageRouter.process(event);
        mockendpoint1.verify();
        mockendpoint2.verify();
View Full Code Here

        assertTrue(router.isMatch(message));
        mockendpoint1.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
        mockendpoint1.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
        mockendpoint2.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
        mockendpoint3.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
        router.route(new OutboundRoutingTestEvent(message, (MuleSession) session.proxy(), muleContext));
        mockendpoint1.verify();
        mockendpoint2.verify();
        mockendpoint3.verify();
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.