Added password to Jedis, JedisPool and ShardedJedis constructor for easier and more efficient usage

This commit is contained in:
Jonathan Leibiusky
2010-09-14 16:43:48 -03:00
parent 708ae8a56e
commit 224555afd2
6 changed files with 53 additions and 21 deletions

View File

@@ -6,8 +6,10 @@ import java.util.Map;
import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.tests.commands.JedisCommandTestBase;
import redis.clients.util.RedisOutputStream;
import redis.clients.util.ShardInfo;
public class JedisTest extends JedisCommandTestBase {
@Test
@@ -31,4 +33,11 @@ public class JedisTest extends JedisCommandTestBase {
assertEquals(hash, jedis.hgetAll("foo"));
}
@Test
public void connectWithShardInfo() {
ShardInfo shardInfo = new ShardInfo("localhost", Protocol.DEFAULT_PORT);
shardInfo.setPassword("foobared");
Jedis jedis = new Jedis(shardInfo);
jedis.get("foo");
}
}