Only run SRP getRange tests if Redis version >= 2.4
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.data.redis.connection.srp;
|
||||
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
import org.junit.After;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@@ -24,6 +25,8 @@ import org.springframework.data.redis.connection.AbstractConnectionIntegrationTe
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import redis.client.RedisClientBase;
|
||||
|
||||
/**
|
||||
* Integration test of {@link SrpConnection}
|
||||
*
|
||||
@@ -97,4 +100,14 @@ public class SrpConnectionIntegrationTests extends AbstractConnectionIntegration
|
||||
public void testZUnionStoreAggWeights() {
|
||||
super.testZUnionStoreAggWeights();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRangeSetRange() {
|
||||
assumeTrue(getRedisVersion() >= RedisClientBase.parseVersion("2.4.0"));
|
||||
super.testGetRangeSetRange();
|
||||
}
|
||||
|
||||
private int getRedisVersion() {
|
||||
return RedisClientBase.parseVersion((String)connection.info().get("redis_version"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -38,6 +39,7 @@ import org.springframework.data.redis.serializer.SerializationUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import redis.client.RedisClientBase;
|
||||
import redis.reply.BulkReply;
|
||||
import redis.reply.Reply;
|
||||
|
||||
@@ -185,6 +187,19 @@ public class SrpConnectionPipelineIntegrationTests extends
|
||||
verifyResults(Arrays.asList(new Object[] { 1l, 1l, 1l, "3" }), actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRangeSetRange() {
|
||||
assumeTrue(getRedisVersion() >= RedisClientBase.parseVersion("2.4.0"));
|
||||
super.testGetRangeSetRange();
|
||||
}
|
||||
|
||||
private int getRedisVersion() {
|
||||
connection.closePipeline();
|
||||
int version = RedisClientBase.parseVersion((String)connection.info().get("redis_version"));
|
||||
connection.openPipeline();
|
||||
return version;
|
||||
}
|
||||
|
||||
protected Object convertResult(Object result) {
|
||||
Object convertedResult = super.convertResult(result);
|
||||
if (convertedResult instanceof Reply[]) {
|
||||
|
||||
Reference in New Issue
Block a user