Flush to socket when starting to read

This commit is contained in:
Pieter Noordhuis
2011-02-25 13:00:34 +01:00
parent dad1b8c394
commit 9dd23cec81
3 changed files with 18 additions and 3 deletions

View File

@@ -22,11 +22,12 @@ public class ProtocolTest extends JedisTestBase {
PipedInputStream pis = new PipedInputStream();
BufferedInputStream bis = new BufferedInputStream(pis);
PipedOutputStream pos = new PipedOutputStream(pis);
RedisOutputStream ros = new RedisOutputStream(pos);
Protocol protocol = new Protocol();
protocol.sendCommand(new RedisOutputStream(pos), Protocol.Command.GET,
protocol.sendCommand(ros, Protocol.Command.GET,
"SOMEKEY".getBytes(Protocol.CHARSET));
ros.flush();
pos.close();
String expectedCommand = "*2\r\n$3\r\nGET\r\n$7\r\nSOMEKEY\r\n";