Add Redis 2.6 info(section) method to Connections
DATAREDIS-183
This commit is contained in:
@@ -458,6 +458,16 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
Properties info = connection.info("server");
|
||||
assertNotNull(info);
|
||||
assertTrue("at least 5 settings should be present", info.size() >= 5);
|
||||
String version = info.getProperty("redis_version");
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullKey() throws Exception {
|
||||
try {
|
||||
|
||||
@@ -176,6 +176,12 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
super.testSRandMemberCountNegative();
|
||||
}
|
||||
|
||||
@Test(expected=UnsupportedOperationException.class)
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
super.testInfoBySection();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncrDecrByLong() {
|
||||
String key = "test.count";
|
||||
|
||||
@@ -363,6 +363,12 @@ public class JedisConnectionPipelineIntegrationTests extends
|
||||
super.testSRandMemberCountNegative();
|
||||
}
|
||||
|
||||
@Test(expected=UnsupportedOperationException.class)
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
super.testInfoBySection();
|
||||
}
|
||||
|
||||
// Overrides, usually due to return values being Long vs Boolean or Set vs
|
||||
// List
|
||||
|
||||
|
||||
@@ -517,6 +517,12 @@ public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrat
|
||||
super.testSRandMemberCountNegative();
|
||||
}
|
||||
|
||||
@Test(expected=UnsupportedOperationException.class)
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
super.testInfoBySection();
|
||||
}
|
||||
|
||||
// Jredis returns null for rPush
|
||||
@Test
|
||||
public void testSort() {
|
||||
|
||||
@@ -174,6 +174,18 @@ public class LettuceConnectionPipelineIntegrationTests extends
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
assertNull(connection.info("server"));
|
||||
List<Object> results = getResults();
|
||||
assertEquals(1, results.size());
|
||||
Properties info = LettuceUtils.info((String) results.get(0));
|
||||
assertTrue("at least 5 settings should be present", info.size() >= 5);
|
||||
String version = info.getProperty("redis_version");
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMSetNx() {
|
||||
Map<String, String> vals = new HashMap<String, String>();
|
||||
|
||||
@@ -50,6 +50,18 @@ public class LettuceConnectionPipelineTxIntegrationTests extends
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
assertNull(connection.info("server"));
|
||||
List<Object> results = getResults();
|
||||
assertEquals(2, results.size());
|
||||
Properties info = LettuceUtils.info((String) results.get(1));
|
||||
assertTrue("at least 5 settings should be present", info.size() >= 5);
|
||||
String version = info.getProperty("redis_version");
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test(expected=RedisPipelineException.class)
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testRestoreBadData() {
|
||||
|
||||
@@ -119,6 +119,18 @@ public class SrpConnectionPipelineIntegrationTests extends
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6")
|
||||
public void testInfoBySection() throws Exception {
|
||||
assertNull(connection.info("server"));
|
||||
List<Object> results = getResults();
|
||||
assertEquals(1, results.size());
|
||||
Properties info = SrpUtils.info(new BulkReply((byte[]) results.get(0)));
|
||||
assertTrue("at least 5 settings should be present", info.size() >= 5);
|
||||
String version = info.getProperty("redis_version");
|
||||
assertNotNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExists() {
|
||||
connection.set("existent", "true");
|
||||
|
||||
Reference in New Issue
Block a user