public class JedisPoolTest extends Assert {
private static HostAndPort hnp = HostAndPortUtil.getRedisServers().get(0);
@Test
public void checkConnections() {
JedisPool pool = new JedisPool(new JedisPoolConfig(), hnp.getHost(),
hnp.getPort(), 2000);
Jedis jedis = pool.getResource();
jedis.auth("foobared");
jedis.set("foo", "bar");
assertEquals("bar", jedis.get("foo"));
pool.returnResource(jedis);
pool.destroy();
assertTrue(pool.isClosed());
}