Skip to content

Commit

Permalink
Fix proxy test
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Friedman committed Oct 11, 2017
1 parent f2fc333 commit 981072a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.URISyntaxException;
import java.text.ParseException;
Expand Down Expand Up @@ -141,7 +142,8 @@ public void testProxy() throws URISyntaxException, StorageException {
fail("Bad proxy should throw an exception.");
} catch (StorageException e) {
if (e.getCause().getClass() != ConnectException.class &&
e.getCause().getClass() != SocketTimeoutException.class) {
e.getCause().getClass() != SocketTimeoutException.class &&
e.getCause().getClass() != SocketException.class) {
Assert.fail("Unepected exception for bad proxy");
}
}
Expand All @@ -167,7 +169,8 @@ public void testDefaultProxy() throws URISyntaxException, StorageException {
fail("Bad proxy should throw an exception.");
} catch (StorageException e) {
if (e.getCause().getClass() != ConnectException.class &&
e.getCause().getClass() != SocketTimeoutException.class) {
e.getCause().getClass() != SocketTimeoutException.class &&
e.getCause().getClass() != SocketException.class) {
Assert.fail("Unepected exception for bad proxy");
}
}
Expand Down

0 comments on commit 981072a

Please sign in to comment.