Fix some more U tests ...
This commit is contained in:
@@ -140,7 +140,12 @@ public class Connection {
|
|||||||
|
|
||||||
protected String getStatusCodeReply() {
|
protected String getStatusCodeReply() {
|
||||||
pipelinedCommands--;
|
pipelinedCommands--;
|
||||||
return (String) protocol.read(inputStream);
|
final byte[] resp = (byte[]) protocol.read(inputStream);
|
||||||
|
if (null == resp) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return new String(resp, Protocol.UTF8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBulkReply() {
|
public String getBulkReply() {
|
||||||
@@ -169,7 +174,11 @@ public class Connection {
|
|||||||
}
|
}
|
||||||
final ArrayList<String> result = new ArrayList<String>(bresult.size());
|
final ArrayList<String> result = new ArrayList<String>(bresult.size());
|
||||||
for(final byte[] barray : bresult) {
|
for(final byte[] barray : bresult) {
|
||||||
result.add(new String(barray, Protocol.UTF8));
|
if( barray == null) {
|
||||||
|
result.add(null);
|
||||||
|
} else {
|
||||||
|
result.add(new String(barray, Protocol.UTF8));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ public final class Protocol {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String processStatusCodeReply(final RedisInputStream is) {
|
private byte[] processStatusCodeReply(final RedisInputStream is) {
|
||||||
return is.readLine();
|
return is.readLine().getBytes(UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] processBulkReply(final RedisInputStream is) {
|
private byte[] processBulkReply(final RedisInputStream is) {
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ public class ControlCommandsTest extends JedisCommandTestBase {
|
|||||||
String status = jedis.bgsave();
|
String status = jedis.bgsave();
|
||||||
assertEquals("Background saving started", status);
|
assertEquals("Background saving started", status);
|
||||||
} catch (JedisException e) {
|
} catch (JedisException e) {
|
||||||
assertEquals("ERR Background save already in progress", e
|
assertTrue(
|
||||||
.getMessage());
|
"ERR Background save already in progress"
|
||||||
|
.equalsIgnoreCase(e.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user