Merge pull request #208 from yaourt/brokenShardedTestFix

Broken sharded test fix
This commit is contained in:
Jonathan Leibiusky
2011-12-13 13:03:10 -08:00

View File

@@ -13,7 +13,7 @@ import static junit.framework.Assert.assertNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
public class SharedJedisPipelineTest {
public class ShardedJedisPipelineTest {
private static HostAndPortUtil.HostAndPort redis1 = HostAndPortUtil.getRedisServers()
.get(0);
private static HostAndPortUtil.HostAndPort redis2 = HostAndPortUtil.getRedisServers()
@@ -24,18 +24,25 @@ public class SharedJedisPipelineTest {
@Before
public void setUp() throws Exception {
Jedis jedis = new Jedis(redis1.host, redis1.port);
jedis.auth("foobared");
jedis.flushAll();
jedis.disconnect();
jedis = new Jedis(redis2.host, redis2.port);
jedis.auth("foobared");
jedis.flushAll();
jedis.disconnect();
List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
shards.add(new JedisShardInfo(redis1.host, redis1.port));
shards.add(new JedisShardInfo(redis2.host, redis2.port));
JedisShardInfo si1 = new JedisShardInfo(redis1.host, redis1.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);
}
@Test
public void pipeline() throws UnsupportedEncodingException {
ShardedJedisPipeline p = jedis.pipelined();