@Test public void shouldPlaceMultipleMessagesInSameBuffer() throws Exception { final FixMessage loginMessage = new FixMessageBuilder().messageType(MsgType.LOGIN).msgSeqNum(1).senderCompID("username").targetCompID("LMXBL"). sendingTime(DateTime.parse("19981231-23:58:59.000", DATE_TIME_FORMATTER)).username("username").password("password").heartBtInt(100000).encryptMethod(EncryptMethod.NONE).build(); final FixMessage logoutMessage = new FixMessageBuilder().messageType(MsgType.LOGOUT).msgSeqNum(2).senderCompID("username").targetCompID("LMXBL"). sendingTime(DateTime.parse("19981231-23:59:59.000", DATE_TIME_FORMATTER)).build(); final List<FixMessage> expected = newArrayList(loginMessage, logoutMessage); mockery.checking(new Expectations() { { one(writableByteChannel).write(with(new ByteBufferMatcher(expected))); } }); handler.send(expected); }
public void send(FixMessage message) { final byte[] bytes = message.toFixString().getBytes(); sendBytes(bytes); }
OutboundMessageHandler { public void send(FixMessage message) { final byte[] bytes = message.toFixString().getBytes(); sendBytes(bytes); } }
OutboundMessageHandler { public void send(FixMessage message) { final byte[] bytes = message.toFixString().getBytes(); sendBytes(bytes); } OutboundMessageHandler(final ConnectionObserver connectionObserver); }
OutboundMessageHandler { public void send(FixMessage message) { final byte[] bytes = message.toFixString().getBytes(); sendBytes(bytes); } OutboundMessageHandler(final ConnectionObserver connectionObserver); void send(FixMessage message); void send(Collection<FixMessage> messages); void send(final String message); void sendBytes(final byte[] bytes); void initialiseOutboundChannel(final WritableByteChannel writableByteChannel); }
OutboundMessageHandler { public void send(FixMessage message) { final byte[] bytes = message.toFixString().getBytes(); sendBytes(bytes); } OutboundMessageHandler(final ConnectionObserver connectionObserver); void send(FixMessage message); void send(Collection<FixMessage> messages); void send(final String message); void sendBytes(final byte[] bytes); void initialiseOutboundChannel(final WritableByteChannel writableByteChannel);  }