On reconnection, select the correct db index

This commit is contained in:
Jonathan Leibiusky
2011-05-15 22:17:21 -03:00
parent 20ee796fa8
commit 607d31d96b
3 changed files with 19 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package redis.clients.jedis.tests;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -59,4 +60,13 @@ public class JedisTest extends JedisCommandTestBase {
public void failWhenSendingNullValues() {
jedis.set("foo", null);
}
@Test
public void shouldReconnectToSameDB() throws IOException {
jedis.select(1);
jedis.set("foo", "bar");
jedis.getClient().getSocket().shutdownInput();
jedis.getClient().getSocket().shutdownOutput();
assertEquals("bar", jedis.get("foo"));
}
}