add test to check JedisPool with password

This commit is contained in:
Jonathan Leibiusky
2011-05-11 18:34:41 -03:00
parent acb1eb594f
commit cfc906167c

View File

@@ -84,4 +84,15 @@ public class JedisPoolTest extends Assert {
newJedis.auth("foobared");
newJedis.incr("foo");
}
@Test
public void securePool() {
JedisPoolConfig config = new JedisPoolConfig();
config.setTestOnBorrow(true);
JedisPool pool = new JedisPool(config, hnp.host, hnp.port, 2000, "foobared");
Jedis jedis = pool.getResource();
jedis.set("foo", "bar");
pool.returnResource(jedis);
pool.destroy();
}
}