@Test(expected = TransportClosedException.class) public void shouldNotifyTransportObserverWhenAnIOExceptionIsThrownAndCloseTheTransportWhileWritingACollection() throws Exception { mockery.checking(new Expectations() { { one(writableByteChannel).write(with(any(ByteBuffer.class))); will(throwException(new IOException("Broken pipe"))); one(connectionObserver).connectionClosed(); one(writableByteChannel).close(); } }); handler.send(Arrays.asList(new FixMessageBuilder().build())); }
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);  }