use of io.leopard.redis.JedisPool in project leopard by tanhaichao.
the class JedisPoolTest method JedisPool.
@Test
public void JedisPool() {
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(1);
String host = "172.17.1.236";
int port = 6311;
int timeout = 3000;
JedisPool pool = new JedisPool(poolConfig, host, port, timeout, null);
{
Jedis jedis = pool.getResource();
pool.returnBrokenResource(jedis);
pool.returnResource(jedis);
}
{
RedisConnectionListener redisConnectionListener = Mockito.mock(RedisConnectionListener.class);
pool.redisConnectionListener = redisConnectionListener;
Jedis jedis = pool.getResource();
pool.returnBrokenResource(jedis);
pool.returnResource(jedis);
}
}
use of io.leopard.redis.JedisPool in project leopard by tanhaichao.
the class JedisPoolApacheImplTest method JedisPoolApacheImpl.
@Test
public void JedisPoolApacheImpl() throws Exception {
JedisPool jedisPoolMock = Mockito.mock(JedisPool.class);
JedisPoolApacheImpl jedisPool = new JedisPoolApacheImpl("host", 6311, 3000, 16, null);
// LeopardMockito.setProperty(jedisPool, jedisPoolMock, "pool");
jedisPool.getResource();
jedisPool.returnBrokenResource(null);
jedisPool.returnResource(null);
jedisPool.destroy();
}
Aggregations