outbuffer.write(new byte[] {'a'});
outbuffer.flush();
bytesWritten = outbuffer.getMetrics().getBytesTransferred();
Assert.assertEquals(8 + 14 + 2 + 15 + 2 + 16 + 2 + 1, bytesWritten);
final SessionInputBufferMock inbuffer = new SessionInputBufferMock(
outbuffer.getData());
Assert.assertEquals("a", inbuffer.readLine());
Assert.assertEquals("", inbuffer.readLine());
Assert.assertEquals("\r", inbuffer.readLine());
Assert.assertEquals("", inbuffer.readLine());
Assert.assertEquals(s1, inbuffer.readLine());
Assert.assertEquals(s2, inbuffer.readLine());
Assert.assertEquals(s3, inbuffer.readLine());
Assert.assertEquals("a", inbuffer.readLine());
Assert.assertNull(inbuffer.readLine());
Assert.assertNull(inbuffer.readLine());
final long bytesRead = inbuffer.getMetrics().getBytesTransferred();
Assert.assertEquals(bytesWritten, bytesRead);
}