Merge pull request #208 from yaourt/brokenShardedTestFix
Broken sharded test fix
This commit is contained in:
@@ -13,7 +13,7 @@ import static junit.framework.Assert.assertNull;
|
|||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
public class SharedJedisPipelineTest {
|
public class ShardedJedisPipelineTest {
|
||||||
private static HostAndPortUtil.HostAndPort redis1 = HostAndPortUtil.getRedisServers()
|
private static HostAndPortUtil.HostAndPort redis1 = HostAndPortUtil.getRedisServers()
|
||||||
.get(0);
|
.get(0);
|
||||||
private static HostAndPortUtil.HostAndPort redis2 = HostAndPortUtil.getRedisServers()
|
private static HostAndPortUtil.HostAndPort redis2 = HostAndPortUtil.getRedisServers()
|
||||||
@@ -24,18 +24,25 @@ public class SharedJedisPipelineTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
Jedis jedis = new Jedis(redis1.host, redis1.port);
|
Jedis jedis = new Jedis(redis1.host, redis1.port);
|
||||||
|
jedis.auth("foobared");
|
||||||
jedis.flushAll();
|
jedis.flushAll();
|
||||||
jedis.disconnect();
|
jedis.disconnect();
|
||||||
jedis = new Jedis(redis2.host, redis2.port);
|
jedis = new Jedis(redis2.host, redis2.port);
|
||||||
|
jedis.auth("foobared");
|
||||||
jedis.flushAll();
|
jedis.flushAll();
|
||||||
jedis.disconnect();
|
jedis.disconnect();
|
||||||
|
|
||||||
List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
|
List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
|
||||||
shards.add(new JedisShardInfo(redis1.host, redis1.port));
|
JedisShardInfo si1 = new JedisShardInfo(redis1.host, redis1.port);
|
||||||
shards.add(new JedisShardInfo(redis2.host, redis2.port));
|
si1.setPassword("foobared");
|
||||||
|
shards.add(si1);
|
||||||
|
JedisShardInfo si2 = new JedisShardInfo(redis2.host, redis2.port);
|
||||||
|
si2.setPassword("foobared");
|
||||||
|
shards.add(si2);
|
||||||
this.jedis = new ShardedJedis(shards);
|
this.jedis = new ShardedJedis(shards);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void pipeline() throws UnsupportedEncodingException {
|
public void pipeline() throws UnsupportedEncodingException {
|
||||||
ShardedJedisPipeline p = jedis.pipelined();
|
ShardedJedisPipeline p = jedis.pipelined();
|
||||||
Reference in New Issue
Block a user