add JedisDataException and JedisConnectionException

This commit is contained in:
Jonathan Leibiusky
2011-01-30 17:46:17 -03:00
parent b4ad7697b7
commit 2a4a43f4cd
31 changed files with 269 additions and 263 deletions

View File

@@ -1,38 +1,36 @@
package redis.clients.jedis.tests;
import java.io.IOException;
import java.net.UnknownHostException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.Connection;
import redis.clients.jedis.exceptions.JedisConnectionException;
public class ConnectionTest extends Assert {
private Connection client;
@Before
public void setUp() throws Exception {
client = new Connection();
client = new Connection();
}
@After
public void tearDown() throws Exception {
client.disconnect();
client.disconnect();
}
@Test(expected = UnknownHostException.class)
public void checkUnkownHost() throws UnknownHostException, IOException {
client.setHost("someunknownhost");
client.connect();
@Test(expected = JedisConnectionException.class)
public void checkUnkownHost() {
client.setHost("someunknownhost");
client.connect();
}
@Test(expected = IOException.class)
public void checkWrongPort() throws UnknownHostException, IOException {
client.setHost("localhost");
client.setPort(55665);
client.connect();
@Test(expected = JedisConnectionException.class)
public void checkWrongPort() {
client.setHost("localhost");
client.setPort(55665);
client.connect();
}
}