Fixed broken constructor. Wasn't setting default protocol
This commit is contained in:
@@ -12,6 +12,7 @@ public class JedisPool extends FixedResourcePool<Jedis> {
|
||||
|
||||
public JedisPool(String host) {
|
||||
this.host = host;
|
||||
this.port = Protocol.DEFAULT_PORT;
|
||||
}
|
||||
|
||||
public JedisPool(String host, int port) {
|
||||
|
||||
@@ -22,4 +22,18 @@ public class JedisPoolTest extends Assert {
|
||||
assertEquals("bar", jedis.get("foo"));
|
||||
pool.returnResource(jedis);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkConnectionWithDefaultPort() throws TimeoutException {
|
||||
JedisPool pool = new JedisPool("localhost");
|
||||
pool.setResourcesNumber(10);
|
||||
pool.init();
|
||||
|
||||
Jedis jedis = pool.getResource(200);
|
||||
jedis.auth("foobared");
|
||||
jedis.set("foo", "bar");
|
||||
assertEquals("bar", jedis.get("foo"));
|
||||
pool.returnResource(jedis);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,6 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import redis.clients.jedis.Protocol;
|
||||
|
||||
public class HashesCommandsTest extends JedisCommandTestBase {
|
||||
@Test
|
||||
public void hset() {
|
||||
|
||||
Reference in New Issue
Block a user