Enable JRedis Collections tests
This commit is contained in:
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertFalse;
|
||||
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.Collection;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -38,6 +39,7 @@ import org.springframework.cache.Cache.ValueWrapper;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.data.redis.ConnectionFactoryTracker;
|
||||
import org.springframework.data.redis.ObjectFactory;
|
||||
import org.springframework.data.redis.connection.ConnectionUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.support.collections.CollectionTestParams;
|
||||
|
||||
@@ -78,6 +80,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
ConnectionFactoryTracker.add(template.getConnectionFactory());
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.redis.ObjectFactory;
|
||||
import org.springframework.data.redis.RedisTestProfileValueSource;
|
||||
import org.springframework.data.redis.connection.ConnectionUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.support.collections.DefaultRedisList;
|
||||
import org.springframework.data.redis.support.collections.RedisList;
|
||||
@@ -231,7 +232,8 @@ public abstract class AbstractRedisListTests<T> extends AbstractRedisCollectionT
|
||||
@Test
|
||||
public void testPollTimeout() throws InterruptedException {
|
||||
// 1 ms timeout gets upgraded to 1 sec timeout at the moment
|
||||
assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true"));
|
||||
assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true") &&
|
||||
!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
list.add(t1);
|
||||
assertEquals(t1, list.poll(1, TimeUnit.MILLISECONDS));
|
||||
@@ -465,7 +467,8 @@ public abstract class AbstractRedisListTests<T> extends AbstractRedisCollectionT
|
||||
@Test
|
||||
public void testPollLastTimeout() throws InterruptedException {
|
||||
// 1 ms timeout gets upgraded to 1 sec timeout at the moment
|
||||
assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true"));
|
||||
assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true") &&
|
||||
!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
|
||||
|
||||
@@ -246,6 +246,7 @@ public abstract class AbstractRedisZSetTest<T> extends AbstractRedisCollectionTe
|
||||
|
||||
@Test
|
||||
public void testRangeWithScores() {
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
T t3 = getT();
|
||||
@@ -286,6 +287,7 @@ public abstract class AbstractRedisZSetTest<T> extends AbstractRedisCollectionTe
|
||||
|
||||
@Test
|
||||
public void testReverseRangeWithScores() {
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
T t3 = getT();
|
||||
@@ -309,6 +311,7 @@ public abstract class AbstractRedisZSetTest<T> extends AbstractRedisCollectionTe
|
||||
|
||||
@Test
|
||||
public void testReverseRangeByScore() {
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
T t3 = getT();
|
||||
@@ -326,6 +329,7 @@ public abstract class AbstractRedisZSetTest<T> extends AbstractRedisCollectionTe
|
||||
|
||||
@Test
|
||||
public void testReverseRangeByScoreWithScores() {
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
T t3 = getT();
|
||||
@@ -369,6 +373,7 @@ public abstract class AbstractRedisZSetTest<T> extends AbstractRedisCollectionTe
|
||||
|
||||
@Test
|
||||
public void testRangeByScoreWithScores() {
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
T t3 = getT();
|
||||
|
||||
@@ -161,14 +161,14 @@ public abstract class CollectionTestParams {
|
||||
jsonPersonTemplateLtc.afterPropertiesSet();
|
||||
|
||||
return Arrays.asList(new Object[][] { { stringFactory, stringTemplate },
|
||||
//{ stringFactory, stringTemplateJR },
|
||||
//{ personFactory, personTemplateJR },
|
||||
{ stringFactory, stringTemplateJR },
|
||||
{ personFactory, personTemplateJR },
|
||||
{ personFactory, personTemplate },
|
||||
{ stringFactory, xstreamStringTemplate }, { personFactory, xstreamPersonTemplate },
|
||||
//{ stringFactory, xstreamStringTemplateJR },
|
||||
//{ personFactory, xstreamPersonTemplateJR },
|
||||
{ stringFactory, xstreamStringTemplateJR },
|
||||
{ personFactory, xstreamPersonTemplateJR },
|
||||
{ personFactory, jsonPersonTemplate },
|
||||
//{ personFactory, jsonPersonTemplateJR },
|
||||
{ personFactory, jsonPersonTemplateJR },
|
||||
// srp
|
||||
{ stringFactory, stringTemplateSRP },{ personFactory, personTemplateSRP },
|
||||
{ stringFactory, xstreamStringTemplateSRP }, { personFactory, xstreamPersonTemplateSRP },
|
||||
|
||||
Reference in New Issue
Block a user