Add U test for fragmented processBulkReply patch.

This commit is contained in:
Thomas Sauzedde
2010-09-10 23:26:09 +08:00
committed by Jonathan Leibiusky
parent de5030e13f
commit 97e2a50f60
2 changed files with 40 additions and 0 deletions

View File

@@ -47,6 +47,16 @@ public class ProtocolTest extends Assert {
assertEquals("foobar", response);
}
@Test
public void fragmentedBulkReply() {
FragmentedByteArrayInputStream fis = new FragmentedByteArrayInputStream("$30\r\n012345678901234567890123456789\r\n".getBytes());
Protocol protocol = new Protocol();
String response = (String) protocol.read(new DataInputStream(fis));
assertEquals("012345678901234567890123456789", response);
assertEquals(3, fis.getReadMethodCallCount());
}
@Test
public void nullBulkReply() {
InputStream is = new ByteArrayInputStream("$-1\r\n".getBytes());