Removed timeouts as discussed with @mrniko

pull/616/head
jackygurui 9 years ago
parent f7ab74c574
commit fd1fe5dc8d

@ -2,15 +2,11 @@ package org.redisson;
import java.io.IOException; import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import java.util.concurrent.TimeUnit;
import org.junit.After; import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
import org.reactivestreams.Publisher; import org.reactivestreams.Publisher;
import org.redisson.api.RCollectionReactive; import org.redisson.api.RCollectionReactive;
import org.redisson.api.RScoredSortedSetReactive; import org.redisson.api.RScoredSortedSetReactive;
@ -22,11 +18,6 @@ import reactor.rx.Streams;
public abstract class BaseReactiveTest { public abstract class BaseReactiveTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
protected RedissonReactiveClient redisson; protected RedissonReactiveClient redisson;
protected static RedissonReactiveClient defaultRedisson; protected static RedissonReactiveClient defaultRedisson;

@ -1,25 +1,15 @@
package org.redisson; package org.redisson;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.junit.After; import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.redisson.codec.MsgPackJacksonCodec;
import org.redisson.config.Config; import org.redisson.config.Config;
public abstract class BaseTest { public abstract class BaseTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
protected RedissonClient redisson; protected RedissonClient redisson;
protected static RedissonClient defaultRedisson; protected static RedissonClient defaultRedisson;

@ -33,18 +33,9 @@ import org.redisson.misc.RPromise;
import org.redisson.misc.RedissonPromise; import org.redisson.misc.RedissonPromise;
import io.netty.util.concurrent.FutureListener; import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.ImmediateEventExecutor;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
public class RedisClientTest { public class RedisClientTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@BeforeClass @BeforeClass
public static void beforeClass() throws IOException, InterruptedException { public static void beforeClass() throws IOException, InterruptedException {
if (!RedissonRuntimeEnvironment.isTravis) { if (!RedissonRuntimeEnvironment.isTravis) {

@ -11,20 +11,12 @@ import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
import org.redisson.api.RCountDownLatch; import org.redisson.api.RCountDownLatch;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
public class RedissonCountDownLatchConcurrentTest { public class RedissonCountDownLatchConcurrentTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@BeforeClass @BeforeClass
public static void beforeClass() throws IOException, InterruptedException { public static void beforeClass() throws IOException, InterruptedException {
if (!RedissonRuntimeEnvironment.isTravis) { if (!RedissonRuntimeEnvironment.isTravis) {

@ -14,17 +14,9 @@ import org.redisson.config.Config;
import static com.jayway.awaitility.Awaitility.await; import static com.jayway.awaitility.Awaitility.await;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
public class RedissonMultiLockTest { public class RedissonMultiLockTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Test @Test
public void testMultiThreads() throws IOException, InterruptedException { public void testMultiThreads() throws IOException, InterruptedException {
RedisProcess redis1 = redisTestMultilockInstance(); RedisProcess redis1 = redisTestMultilockInstance();

@ -16,17 +16,9 @@ import org.redisson.config.Config;
import static com.jayway.awaitility.Awaitility.await; import static com.jayway.awaitility.Awaitility.await;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
public class RedissonRedLockTest { public class RedissonRedLockTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Test @Test
public void testLockFailed() throws IOException, InterruptedException { public void testLockFailed() throws IOException, InterruptedException {
RedisProcess redis1 = redisTestMultilockInstance(); RedisProcess redis1 = redisTestMultilockInstance();

@ -24,7 +24,6 @@ import org.redisson.api.RedissonClient;
import org.redisson.client.RedisConnectionException; import org.redisson.client.RedisConnectionException;
import org.redisson.client.RedisException; import org.redisson.client.RedisException;
import org.redisson.client.RedisOutOfMemoryException; import org.redisson.client.RedisOutOfMemoryException;
import org.redisson.client.WriteRedisConnectionException;
import org.redisson.client.protocol.decoder.ListScanResult; import org.redisson.client.protocol.decoder.ListScanResult;
import org.redisson.codec.SerializationCodec; import org.redisson.codec.SerializationCodec;
import org.redisson.config.Config; import org.redisson.config.Config;
@ -32,18 +31,10 @@ import org.redisson.connection.ConnectionListener;
import static com.jayway.awaitility.Awaitility.await; import static com.jayway.awaitility.Awaitility.await;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
import static org.redisson.BaseTest.createInstance; import static org.redisson.BaseTest.createInstance;
public class RedissonTest { public class RedissonTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
protected RedissonClient redisson; protected RedissonClient redisson;
protected static RedissonClient defaultRedisson; protected static RedissonClient defaultRedisson;

@ -19,28 +19,18 @@ import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
import org.redisson.RedisRunner.RedisProcess; import org.redisson.RedisRunner.RedisProcess;
import org.redisson.api.RPatternTopic; import org.redisson.api.RPatternTopic;
import org.redisson.api.RTopic; import org.redisson.api.RTopic;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.redisson.api.listener.BasePatternStatusListener; import org.redisson.api.listener.BasePatternStatusListener;
import org.redisson.api.listener.MessageListener;
import org.redisson.api.listener.PatternMessageListener; import org.redisson.api.listener.PatternMessageListener;
import org.redisson.api.listener.PatternStatusListener; import org.redisson.api.listener.PatternStatusListener;
import org.redisson.api.listener.StatusListener;
import org.redisson.config.Config; import org.redisson.config.Config;
public class RedissonTopicPatternTest { public class RedissonTopicPatternTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@BeforeClass @BeforeClass
public static void beforeClass() throws IOException, InterruptedException { public static void beforeClass() throws IOException, InterruptedException {
if (!RedissonRuntimeEnvironment.isTravis) { if (!RedissonRuntimeEnvironment.isTravis) {

@ -23,7 +23,6 @@ import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import org.redisson.RedisRunner.RedisProcess; import org.redisson.RedisRunner.RedisProcess;
import org.redisson.api.RBlockingQueue;
import org.redisson.api.RSet; import org.redisson.api.RSet;
import org.redisson.api.RTopic; import org.redisson.api.RTopic;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
@ -36,17 +35,9 @@ import org.redisson.config.Config;
import com.jayway.awaitility.Awaitility; import com.jayway.awaitility.Awaitility;
import com.jayway.awaitility.Duration; import com.jayway.awaitility.Duration;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
public class RedissonTopicTest { public class RedissonTopicTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@BeforeClass @BeforeClass
public static void beforeClass() throws IOException, InterruptedException { public static void beforeClass() throws IOException, InterruptedException {
if (!RedissonRuntimeEnvironment.isTravis) { if (!RedissonRuntimeEnvironment.isTravis) {

@ -17,22 +17,13 @@ import org.redisson.config.Config;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
import static org.redisson.BaseTest.createInstance; import static org.redisson.BaseTest.createInstance;
@RunWith(Parameterized.class) @RunWith(Parameterized.class)
public class RedissonTwoLockedThread { public class RedissonTwoLockedThread {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Parameterized.Parameters(name= "{index} - {0}") @Parameterized.Parameters(name= "{index} - {0}")
public static Iterable<Object[]> data() { public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][] {{new JsonJacksonCodec()}, {new SerializationCodec()}}); return Arrays.asList(new Object[][] {{new JsonJacksonCodec()}, {new SerializationCodec()}});

@ -13,20 +13,11 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.Timeout;
public class JsonJacksonMapValueCodecTest { public class JsonJacksonMapValueCodecTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
private final JsonJacksonMapValueCodec<Map<String, List<String>>> mapCodec = new JsonJacksonMapValueCodec<Map<String, List<String>>>(new TypeReference<Map<String, List<String>>>() { private final JsonJacksonMapValueCodec<Map<String, List<String>>> mapCodec = new JsonJacksonMapValueCodec<Map<String, List<String>>>(new TypeReference<Map<String, List<String>>>() {
}); });

@ -1,17 +1,12 @@
package org.redisson.connection.balancer; package org.redisson.connection.balancer;
import static com.jayway.awaitility.Awaitility.await;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
import org.redisson.RedisRunner; import org.redisson.RedisRunner;
import org.redisson.RedisRunner.RedisProcess; import org.redisson.RedisRunner.RedisProcess;
import org.redisson.Redisson; import org.redisson.Redisson;
@ -21,11 +16,6 @@ import org.redisson.config.ReadMode;
public class WeightedRoundRobinBalancerTest { public class WeightedRoundRobinBalancerTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Test @Test
public void testUseMasterForReadsIfNoConnectionsToSlaves() throws IOException, InterruptedException { public void testUseMasterForReadsIfNoConnectionsToSlaves() throws IOException, InterruptedException {
RedisProcess master = null; RedisProcess master = null;

@ -3,19 +3,11 @@ package org.redisson.misc;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
public class LFUCacheMapTest { public class LFUCacheMapTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Test @Test
public void testMaxIdleTimeEviction() throws InterruptedException { public void testMaxIdleTimeEviction() throws InterruptedException {
Cache<Integer, Integer> map = new LFUCacheMap<Integer, Integer>(2, 0, 0); Cache<Integer, Integer> map = new LFUCacheMap<Integer, Integer>(2, 0, 0);

@ -3,19 +3,11 @@ package org.redisson.misc;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
public class LRUCacheMapTest { public class LRUCacheMapTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Test @Test
public void testMaxIdleTimeEviction() throws InterruptedException { public void testMaxIdleTimeEviction() throws InterruptedException {
Cache<Integer, Integer> map = new LRUCacheMap<Integer, Integer>(2, 0, 0); Cache<Integer, Integer> map = new LRUCacheMap<Integer, Integer>(2, 0, 0);

@ -3,19 +3,11 @@ package org.redisson.misc;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
public class NoneCacheMapTest { public class NoneCacheMapTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
@Test @Test
public void testMaxIdleTimeEviction() throws InterruptedException { public void testMaxIdleTimeEviction() throws InterruptedException {
Cache<Integer, Integer> map = new NoneCacheMap<Integer, Integer>(0, 0); Cache<Integer, Integer> map = new NoneCacheMap<Integer, Integer>(0, 0);

@ -6,13 +6,9 @@ import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.Timeout;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Parameterized; import org.junit.runners.Parameterized;
import org.redisson.BaseTest; import org.redisson.BaseTest;
@ -34,11 +30,6 @@ import org.springframework.stereotype.Service;
@RunWith(Parameterized.class) @RunWith(Parameterized.class)
public class RedissonSpringCacheTest { public class RedissonSpringCacheTest {
@ClassRule
public static Timeout classTimeout = new Timeout(1, TimeUnit.HOURS);
@Rule
public Timeout testTimeout = new Timeout(15, TimeUnit.MINUTES);
public static class SampleObject { public static class SampleObject {
private String name; private String name;

Loading…
Cancel
Save