@Test public void testFrameWriterLogsFramesToTracer() { List<TransportFrame> frames = new ArrayList<>(); transport.setProtocolTracer(new ProtocolTracer() { @Override public void sentFrame(final TransportFrame transportFrame) { frames.add(transportFrame); } @Override public void receivedFrame(TransportFrame transportFrame) { } }); Transfer transfer = createTransfer(); FrameWriter framer = new FrameWriter(encoder, Integer.MAX_VALUE, (byte) 0, transport); framer.writeFrame(16, transfer, bigPayload, new PartialTransferHandler(transfer)); assertEquals(1, frames.size()); TransportFrame sentFrame = frames.get(0); assertEquals(16, sentFrame.getChannel()); assertTrue(sentFrame.getBody() instanceof Transfer); Binary payload = sentFrame.getPayload(); assertEquals(bigPayload.capacity(), payload.getLength()); }
void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport); }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport);  }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport);   }