assertEquals("1000", new String(((CachedData) command.getResult())
.getData()));
}
public void testGetsOneDecode() {
Command command = this.commandFactory.createGetCommand("test", "test"
.getBytes(), CommandType.GETS_ONE, null);
checkDecodeNullAndNotLineByteBuffer(command);
checkDecodeInvalidLine(command, "STORED\r\n");
checkDecodeInvalidLine(command, "NOT_FOUND\r\n");
checkDecodeInvalidLine(command, "NOT_STORED\r\n");
checkDecodeInvalidLine(command, "DELETED\r\n");
checkDecodeValidLine(command, "END\r\n");
assertNull(command.getResult());
assertEquals(0, command.getLatch().getCount());
command = this.commandFactory.createGetCommand("test", "test"
.getBytes(), CommandType.GET_ONE, null);
assertFalse(command.decode(null, ByteBuffer
.wrap("VALUE test 0 2 999\r\n10\r\n".getBytes())));
assertNull(command.getResult());
checkDecodeValidLine(command, "VALUE test 0 2 999\r\n10\r\nEND\r\n");
assertEquals("10", new String(((CachedData) command.getResult())
.getData()));
assertEquals(999, ((CachedData) command.getResult()).getCas());
}