Package quickfix

Examples of quickfix.Session


        Mockito.verify(mockSession).send(inboundFixMessage);
    }
   
    @Test
    public void processInOnlyExchangeSendUnsuccessful() throws Exception {
        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
        Mockito.doReturn(false).when(mockSession).send(Matchers.isA(Message.class));

        producer.process(mockExchange);
       
View Full Code Here


       
        final Message outboundFixMessage = new Email();
        outboundFixMessage.getHeader().setString(SenderCompID.FIELD, "TARGET");
        outboundFixMessage.getHeader().setString(TargetCompID.FIELD, "SENDER");
       
        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
        Mockito.doAnswer(new Answer<Boolean>() {
            @Override
            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                new Timer().schedule(new TimerTask() {               
View Full Code Here

               
        final Message outboundFixMessage = new Email();
        outboundFixMessage.getHeader().setString(SenderCompID.FIELD, "TARGET");
        outboundFixMessage.getHeader().setString(TargetCompID.FIELD, "SENDER");
       
        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
        Mockito.doAnswer(new Answer<Boolean>() {
            @Override
            public Boolean answer(InvocationOnMock invocation) throws Throwable {
                new Timer().schedule(new TimerTask() {               
View Full Code Here

    @Test
    public void processInOutExchange() throws Exception {
        org.apache.camel.Message mockCamelOutMessage = Mockito.mock(org.apache.camel.Message.class);
        org.apache.camel.Message mockCamelInMessage = Mockito.mock(org.apache.camel.Message.class);
        SessionID mockSessionId = Mockito.mock(SessionID.class);
        Session mockSession = Mockito.mock(Session.class);

        QuickfixjConsumer consumer = Mockito.spy(new QuickfixjConsumer(mockEndpoint, mockProcessor));
        Mockito.doReturn(mockSession).when(consumer).getSession(mockSessionId);
        Mockito.doReturn(true).when(mockSession).send(Matchers.isA(Message.class));
View Full Code Here

        SessionID messageSessionID = getEndpoint().getSessionID();
        if (messageSessionID == null) {
            messageSessionID = MessageUtils.getSessionID(message);
        }

        Session session = getSession(messageSessionID);
        if (session == null) {
            throw new IllegalStateException("Unknown session: " + messageSessionID);
        }

        Callable<Message> callable = null;

        if (exchange.getPattern().isOutCapable()) {
            MessageCorrelator messageCorrelator = getEndpoint().getEngine().getMessageCorrelator();
            callable = messageCorrelator.getReply(getEndpoint().getSessionID(), exchange);
        }

        if (!session.send(message)) {
            throw new CannotSendException("Cannot send FIX message: " + message.toString());
        }

        if (callable != null) {
            Message reply = callable.call();
View Full Code Here

TOP

Related Classes of quickfix.Session

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.