transmitter.write(new byte[] {'a'});
transmitter.flush();
writedBytes = transmitter.getMetrics().getBytesTransferred();
assertEquals(8 + 14 + 2 + 15 + 2 + 16 + 2 + 1, writedBytes);
HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
transmitter.getData());
assertEquals("a", receiver.readLine());
assertEquals("", receiver.readLine());
assertEquals("\r", receiver.readLine());
assertEquals("", receiver.readLine());
assertEquals(s1, receiver.readLine());
assertEquals(s2, receiver.readLine());
assertEquals(s3, receiver.readLine());
assertEquals("a", receiver.readLine());
assertNull(receiver.readLine());
assertNull(receiver.readLine());
long received = receiver.getMetrics().getBytesTransferred();
assertEquals(writedBytes, received);
}