Addded default socket timeout of 2000 ms

This commit is contained in:
Jonathan Leibiusky
2010-08-08 14:52:35 -03:00
parent 8372092b96
commit 048d87d26c
4 changed files with 53 additions and 9 deletions

View File

@@ -11,4 +11,4 @@ public class JedisTest {
Jedis jedis = new Jedis("localhost");
jedis.dbSize();
}
}
}

View File

@@ -9,6 +9,7 @@ import org.junit.After;
import org.junit.Before;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Protocol;
public abstract class JedisCommandTestBase extends Assert {
@@ -20,7 +21,7 @@ public abstract class JedisCommandTestBase extends Assert {
@Before
public void setUp() throws Exception {
jedis = new Jedis("localhost");
jedis = new Jedis("localhost", Protocol.DEFAULT_PORT, 500);
jedis.connect();
jedis.auth("foobared");
jedis.flushDB();
@@ -32,10 +33,10 @@ public abstract class JedisCommandTestBase extends Assert {
}
protected Jedis createJedis() throws UnknownHostException, IOException {
Jedis j = new Jedis("localhost");
j.connect();
j.auth("foobared");
j.flushAll();
return j;
Jedis j = new Jedis("localhost");
j.connect();
j.auth("foobared");
j.flushAll();
return j;
}
}