4243444546474849505152
} private void run(String password) { try { JRedis jredis = new JRedisClient("localhost", 6379, "jredis", 0); jredis.ping(); if(!jredis.exists(key)) { jredis.set(key, "Hello Again!"); System.out.format("Hello! You should run me again!\n"); }
4647484950515253545556
private void run(String password) { try { ConnectionSpec spec = DefaultConnectionSpec.newSpec().setCredentials(password); JRedis jredis = new JRedisClient(spec); jredis.ping(); if(!jredis.exists(bkey)) { jredis.set(bkey, "Hello Again!"); System.out.format("Hello! You should run me again!\n"); }
5758596061626364656667
@Test public void testGetResource() throws RedisException { this.pool = new JredisPool(connectionSpec); JRedis client = pool.getResource(); assertNotNull(client); client.ping(); } @Test public void testGetResourcePoolExhausted() { GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();