package org.darkphoenixs.pool.hbase;

import org.apache.hadoop.hbase.client.Connection;
import org.junit.Test;

public class HbaseSharedConnPoolTest {

    @Test
    public void test() throws Exception {

        HbaseSharedConnPool pool = HbaseSharedConnPool.getInstance(HbaseConfig.DEFAULT_HOST, HbaseConfig.DEFAULT_PORT, HbaseConfig.DEFAULT_MASTER, HbaseConfig.DEFAULT_ROOTDIR);

        try {

            pool = HbaseSharedConnPool.getInstance(null, HbaseConfig.DEFAULT_PORT, "localhost:60000", "hdfs://localhost:8020/hbase");

            pool = HbaseSharedConnPool.getInstance(HbaseConfig.DEFAULT_HOST, null, "localhost:60000", "hdfs://localhost:8020/hbase");

        } catch (Exception e) {

        }

        Connection conn = pool.getConnection();

        pool.returnConnection(conn);

        pool.returnConnection(null);

        pool.returnConnection(conn);

        pool.returnConnection(conn);

        pool.returnConnection(null);

    }
}
@@ -390,16 +390,228 @@
   try %7B%0A
+            pool = HbaseSharedConnPool.getInstance(HbaseConfig.DEFAULT_HOST, HbaseConfig.DEFAULT_PORT, %22localhost:60000%22, %22hdfs://localhost:8020/hbase%22);%0A%0A        %7D catch (Exception e) %7B%0A%0A        %7D%0A%0A        try %7B
 %0A       
@@ -730,32 +730,90 @@
 :8020/hbase%22);%0A%0A
+        %7D catch (Exception e) %7B%0A%0A        %7D%0A%0A        try %7B%0A
             pool
@@ -1105,38 +1105,42 @@
 ;%0A%0A        pool.
-return
+invalidate
 Connection(conn)
@@ -1147,38 +1147,42 @@
 ;%0A%0A        pool.
-return
+invalidate
 Connection(conn)
@@ -1189,38 +1189,42 @@
 ;%0A%0A        pool.
-return
+invalidate
 Connection(null)

fix issues