New exception management. Less exceptions... assume everything works
This commit is contained in:
@@ -13,7 +13,6 @@ import junit.framework.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import redis.clients.jedis.JedisException;
|
||||
import redis.clients.jedis.Protocol;
|
||||
|
||||
public class ProtocolTest extends Assert {
|
||||
@@ -39,7 +38,7 @@ public class ProtocolTest extends Assert {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bulkReply() throws JedisException {
|
||||
public void bulkReply() {
|
||||
InputStream is = new ByteArrayInputStream("$6\r\nfoobar\r\n".getBytes());
|
||||
Protocol protocol = new Protocol();
|
||||
String response = protocol.getBulkReply(is);
|
||||
@@ -47,7 +46,7 @@ public class ProtocolTest extends Assert {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nullBulkReply() throws JedisException {
|
||||
public void nullBulkReply() {
|
||||
InputStream is = new ByteArrayInputStream("$-1\r\n".getBytes());
|
||||
Protocol protocol = new Protocol();
|
||||
String response = protocol.getBulkReply(is);
|
||||
@@ -55,7 +54,7 @@ public class ProtocolTest extends Assert {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void singleLineReply() throws JedisException {
|
||||
public void singleLineReply() {
|
||||
InputStream is = new ByteArrayInputStream("+OK\r\n".getBytes());
|
||||
Protocol protocol = new Protocol();
|
||||
String response = protocol.getStatusCodeReply(is);
|
||||
@@ -63,7 +62,7 @@ public class ProtocolTest extends Assert {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void integerReply() throws JedisException {
|
||||
public void integerReply() {
|
||||
InputStream is = new ByteArrayInputStream(":123\r\n".getBytes());
|
||||
Protocol protocol = new Protocol();
|
||||
int response = protocol.getIntegerReply(is);
|
||||
@@ -72,7 +71,7 @@ public class ProtocolTest extends Assert {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void multiBulkReply() throws JedisException {
|
||||
public void multiBulkReply() {
|
||||
InputStream is = new ByteArrayInputStream(
|
||||
"*4\r\n$3\r\nfoo\r\n$3\r\nbar\r\n$5\r\nHello\r\n$5\r\nWorld\r\n"
|
||||
.getBytes());
|
||||
@@ -106,7 +105,7 @@ public class ProtocolTest extends Assert {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void nullMultiBulkReply() throws JedisException {
|
||||
public void nullMultiBulkReply() {
|
||||
InputStream is = new ByteArrayInputStream("*-1\r\n".getBytes());
|
||||
Protocol protocol = new Protocol();
|
||||
List<String> response = (List<String>) (List<?>) protocol
|
||||
|
||||
Reference in New Issue
Block a user