xetorthio/jedis — pull request #592 by HeartSaVioR (2014-03-16 14:05:40+00:00)
Title: Support Closeable with *Pool itself - #569 with more unit tests

This PR is based on #569, but append unit tests to JedisSentinelPool. ShardedJedisPool.

I've requested @hgschmie to append more unit tests, but nothing updated, so I'm making some works to append these and update.

----

If both #563 and #569 (or this PR) would be merge, we can discuss user level use case (source code) with #563 and #569 .

I think normal case goes on below if we apply both #563 and #569.
````
try (JedisPool jp = new JedisPool(...)) {
// ... some processing (it may calls method inner class or outer class, launch new Thread, blabla...)
// ... finally we reached codes that communicates to Redis
try (Jedis jedis = jp.getResource()) {
...
}
// ... Jedis is closed by try-with-resource
// ... some returning and cleanup, Thread joining, blabla...
}
// ... JedisPool is closed by try-with-resource
````

Please double check use case, so that we can finally replace wiki after applying PRs.
https://github.com/xetorthio/jedis/wiki/Getting-started#wiki-using-jedis-in-a-multithreaded-environment
(Surely we need to explain two version of use case - before / after Java 1.7.)