// Path: src/main/java/org/darkphoenixs/pool/PoolConfig.java
// public class PoolConfig extends GenericObjectPoolConfig implements Serializable {
// 
//     /**
//      * DEFAULT_TEST_WHILE_IDLE
//      */
//     public static final boolean DEFAULT_TEST_WHILE_IDLE = true;
//     /**
//      * DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
//      */
//     public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 60000;
//     /**
//      * DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
//      */
//     public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 30000;
//     /**
//      * DEFAULT_NUM_TESTS_PER_EVICTION_RUN
//      */
//     public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = -1;
//     /**
//      * serialVersionUID
//      */
//     private static final long serialVersionUID = -2414567557372345057L;
// 
//     /**
//      * <p>Title: PoolConfig</p>
//      * <p>Description: 默认构造方法</p>
//      */
//     public PoolConfig() {
// 
//         // defaults to make your life with connection pool easier :)
//         setTestWhileIdle(DEFAULT_TEST_WHILE_IDLE);
//         setMinEvictableIdleTimeMillis(DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
//         setTimeBetweenEvictionRunsMillis(DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
//         setNumTestsPerEvictionRun(DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
//     }
// }


import org.darkphoenixs.pool.PoolConfig;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;

        pool.close();

        pool = new RedisClusterConnPool(new PoolConfig(), jedisClusterNodes);

        pool.close();

    }

    @Test
    public void test1() throws Exception {

        Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
        jedisClusterNodes.add(new HostAndPort(RedisConfig.DEFAULT_HOST, RedisConfig.DEFAULT_PORT));
        RedisClusterConnPool pool = new RedisClusterConnPool(jedisClusterNodes);

        JedisCluster cluster = pool.getConnection();
        Assert.assertNotNull(cluster);

        pool.returnConnection(cluster);
        pool.invalidateConnection(cluster);

        Properties properties = new Properties();
        properties.setProperty(RedisConfig.CLUSTER_PROPERTY, RedisConfig.DEFAULT_HOST + ":" + RedisConfig.DEFAULT_PORT);
        pool = new RedisClusterConnPool(properties);
        cluster = pool.getConnection();
        Assert.assertNotNull(cluster);

        pool.close();

// Path: src/main/java/org/darkphoenixs/pool/PoolConfig.java
// public class PoolConfig extends GenericObjectPoolConfig implements Serializable {
// 
//     /**
//      * DEFAULT_TEST_WHILE_IDLE
//      */
//     public static final boolean DEFAULT_TEST_WHILE_IDLE = true;
//     /**
//      * DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
//      */
//     public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 60000;
//     /**
//      * DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
//      */
//     public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 30000;
//     /**
//      * DEFAULT_NUM_TESTS_PER_EVICTION_RUN
//      */
//     public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = -1;
//     /**
//      * serialVersionUID
//      */
//     private static final long serialVersionUID = -2414567557372345057L;
// 
//     /**
//      * <p>Title: PoolConfig</p>
//      * <p>Description: 默认构造方法</p>
//      */
//     public PoolConfig() {
// 
//         // defaults to make your life with connection pool easier :)
//         setTestWhileIdle(DEFAULT_TEST_WHILE_IDLE);
//         setMinEvictableIdleTimeMillis(DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
//         setTimeBetweenEvictionRunsMillis(DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
//         setNumTestsPerEvictionRun(DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
//     }
// }


// Path: src/test/java/org/darkphoenixs/pool/redis/RedisClusterConnPoolTest.java
import org.darkphoenixs.pool.PoolConfig;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;


        pool.close();

        pool = new RedisClusterConnPool(new PoolConfig(), jedisClusterNodes);

        pool.close();

    }

    @Test
    public void test1() throws Exception {

        Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
        jedisClusterNodes.add(new HostAndPort(RedisConfig.DEFAULT_HOST, RedisConfig.DEFAULT_PORT));
        RedisClusterConnPool pool = new RedisClusterConnPool(jedisClusterNodes);

        JedisCluster cluster = pool.getConnection();
        Assert.assertNotNull(cluster);

        pool.returnConnection(cluster);
        pool.invalidateConnection(cluster);

        Properties properties = new Properties();
        properties.setProperty(RedisConfig.CLUSTER_PROPERTY, RedisConfig.DEFAULT_HOST + ":" + RedisConfig.DEFAULT_PORT);
        pool = new RedisClusterConnPool(properties);
        cluster = pool.getConnection();
        Assert.assertNotNull(cluster);

        pool.close();

        pool = new RedisClusterConnPool(jedisClusterNodes, RedisConfig.DEFAULT_TIMEOUT, RedisConfig.DEFAULT_MAXATTE, new PoolConfig());