Improve test speed and add failure diagnostics
This commit is contained in:
@@ -84,6 +84,9 @@ public class DefaultListOperationsTests<K,V> {
|
||||
V v1 = valueFactory.instance();
|
||||
V v2 = valueFactory.instance();
|
||||
V v3 = valueFactory.instance();
|
||||
System.out.println("Value1" + v1);
|
||||
System.out.println("Value2" + v2);
|
||||
System.out.println("Value3" + v3);
|
||||
assertEquals(Long.valueOf(1),listOps.leftPush(key, v1));
|
||||
assertEquals(Long.valueOf(2),listOps.leftPush(key, v2));
|
||||
assertEquals(Long.valueOf(3), listOps.leftPush(key, v1, v3));
|
||||
|
||||
@@ -452,17 +452,16 @@ public class RedisTemplateTests<K,V> {
|
||||
|
||||
@Test
|
||||
public void testExpireAt() {
|
||||
assumeTrue(RedisTestProfileValueSource.matches("redisVersion", "2.6") &&
|
||||
RedisTestProfileValueSource.matches("runLongTests", "true"));
|
||||
assumeTrue(RedisTestProfileValueSource.matches("redisVersion", "2.6"));
|
||||
final K key1 = keyFactory.instance();
|
||||
V value1 = valueFactory.instance();
|
||||
redisTemplate.boundValueOps(key1).set(value1);
|
||||
redisTemplate.expireAt(key1, new Date(System.currentTimeMillis() + 1000l));
|
||||
redisTemplate.expireAt(key1, new Date(System.currentTimeMillis() + 5l));
|
||||
waitFor(new TestCondition() {
|
||||
public boolean passes() {
|
||||
return (!redisTemplate.hasKey(key1));
|
||||
}
|
||||
}, 1500l);
|
||||
}, 5l);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -231,13 +231,10 @@ 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") &&
|
||||
!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
list.add(t1);
|
||||
assertEquals(t1, list.poll(1, TimeUnit.MILLISECONDS));
|
||||
assertNull(list.poll(1, TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -466,9 +463,7 @@ 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") &&
|
||||
!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
assumeTrue(!ConnectionUtils.isJredis(template.getConnectionFactory()));
|
||||
T t1 = getT();
|
||||
T t2 = getT();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user