Speed up Sentinel related tests

* remove FIXME sleep codes for Sentinel related tests
** add functions for Sentinel tests (JedisSentinelTestUtil)
*** waitForSentinelRecognizeRedisReplication
*** waitForNewPromotedMaster
*** waitForSentinelsRecognizeEachOthers
**** TODO: there're no command for sentinel to list recognized sentinel
**** sleep 5.5 sec (sentinel pings to master every 5 sec)

* set HostAndPort class to public(no longer inner) class
** reason: We cannot know pool's current master if HostAndPort class is
private inner class / HostAndPort classes are duplicated (main/test)
** make getter method and parameterized constructor
*** set fields once, get anytime
This commit is contained in:
Jungtaek Lim
2013-10-07 11:03:32 +09:00
parent 597366343d
commit 7e1a1a70b2
19 changed files with 431 additions and 259 deletions

View File

@@ -1,14 +1,24 @@
package redis.clients.jedis.tests;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.*;
import redis.clients.jedis.exceptions.JedisDataException;
import redis.clients.jedis.tests.HostAndPortUtil.HostAndPort;
import java.io.UnsupportedEncodingException;
import java.util.*;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Pipeline;
import redis.clients.jedis.PipelineBlock;
import redis.clients.jedis.Response;
import redis.clients.jedis.Tuple;
import redis.clients.jedis.exceptions.JedisDataException;
public class PipeliningTest extends Assert {
private static HostAndPort hnp = HostAndPortUtil.getRedisServers().get(0);
@@ -17,7 +27,7 @@ public class PipeliningTest extends Assert {
@Before
public void setUp() throws Exception {
jedis = new Jedis(hnp.host, hnp.port, 500);
jedis = new Jedis(hnp.getHost(), hnp.getPort(), 500);
jedis.connect();
jedis.auth("foobared");
jedis.flushAll();