additional assertions

pull/261/head^2
Nikita 9 years ago
parent 2f5f8e6fdf
commit dab99e363a

@ -6,6 +6,8 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.junit.Assert;
public abstract class BaseConcurrentTest extends BaseTest { public abstract class BaseConcurrentTest extends BaseTest {
protected void testMultiInstanceConcurrency(int iterations, final RedissonRunnable runnable) throws InterruptedException { protected void testMultiInstanceConcurrency(int iterations, final RedissonRunnable runnable) throws InterruptedException {
@ -29,7 +31,7 @@ public abstract class BaseConcurrentTest extends BaseTest {
} }
executor.shutdown(); executor.shutdown();
executor.awaitTermination(5, TimeUnit.MINUTES); Assert.assertTrue(executor.awaitTermination(5, TimeUnit.MINUTES));
System.out.println("multi: " + (System.currentTimeMillis() - watch)); System.out.println("multi: " + (System.currentTimeMillis() - watch));
@ -45,7 +47,7 @@ public abstract class BaseConcurrentTest extends BaseTest {
} }
executor.shutdown(); executor.shutdown();
executor.awaitTermination(5, TimeUnit.MINUTES); Assert.assertTrue(executor.awaitTermination(5, TimeUnit.MINUTES));
} }
protected void testSingleInstanceConcurrency(int iterations, final RedissonRunnable runnable) throws InterruptedException { protected void testSingleInstanceConcurrency(int iterations, final RedissonRunnable runnable) throws InterruptedException {
@ -63,7 +65,7 @@ public abstract class BaseConcurrentTest extends BaseTest {
} }
executor.shutdown(); executor.shutdown();
executor.awaitTermination(5, TimeUnit.MINUTES); Assert.assertTrue(executor.awaitTermination(5, TimeUnit.MINUTES));
System.out.println(System.currentTimeMillis() - watch); System.out.println(System.currentTimeMillis() - watch);

@ -90,7 +90,7 @@ public class RedisClientTest {
} }
pool.shutdown(); pool.shutdown();
pool.awaitTermination(1, TimeUnit.HOURS); Assert.assertTrue(pool.awaitTermination(1, TimeUnit.HOURS));
Assert.assertEquals(100000L, conn.sync(LongCodec.INSTANCE, RedisCommands.GET, "test")); Assert.assertEquals(100000L, conn.sync(LongCodec.INSTANCE, RedisCommands.GET, "test"));

@ -48,7 +48,7 @@ public class RedissonCountDownLatchConcurrentTest {
} }
executor.shutdown(); executor.shutdown();
executor.awaitTermination(10, TimeUnit.SECONDS); Assert.assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS));
redisson.shutdown(); redisson.shutdown();
} }

@ -44,7 +44,7 @@ public class RedissonCountDownLatchTest extends BaseTest {
}); });
executor.shutdown(); executor.shutdown();
executor.awaitTermination(10, TimeUnit.SECONDS); Assert.assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS));
} }
@ -82,7 +82,7 @@ public class RedissonCountDownLatchTest extends BaseTest {
}); });
executor.shutdown(); executor.shutdown();
executor.awaitTermination(10, TimeUnit.SECONDS); Assert.assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS));
} }
@Test @Test

@ -1,16 +1,13 @@
package org.redisson; package org.redisson;
import java.io.Serializable; import java.io.Serializable;
import java.util.Iterator;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.redisson.client.protocol.pubsub.PubSubType;
import org.redisson.core.BaseStatusListener; import org.redisson.core.BaseStatusListener;
import org.redisson.core.MessageListener; import org.redisson.core.MessageListener;
import org.redisson.core.RTopic; import org.redisson.core.RTopic;
import org.redisson.core.StatusListener;
public class RedissonTopicTest { public class RedissonTopicTest {

Loading…
Cancel
Save