Skip to content

Commit

Permalink
KAA-1470. Fix Connectivity Checker test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill380 committed Oct 26, 2016
1 parent a478578 commit a6714a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -50,6 +50,7 @@ public boolean checkConnectivity() {

try {
try (Socket soc = new Socket()) {
// check if we can reach host (ping) thus we test connectivity
soc.connect(new InetSocketAddress(host, DEFAULT_PORT), CONNECTION_TIMEOUT_MS);
}
return true;
Expand Down
Expand Up @@ -23,13 +23,13 @@ public class PingConnectivityCheckerTest {

@Test
public void checkConnectivityToWrongHostTest() {
PingConnectivityChecker pingConnectivityChecker = new PingConnectivityChecker("some-wrong-url=");
PingConnectivityChecker pingConnectivityChecker = new PingConnectivityChecker("wrong-host");
Assert.assertFalse(pingConnectivityChecker.checkConnectivity());
}

@Test
public void checkConnectivityForLocalHostTest() {
PingConnectivityChecker pingConnectivityChecker = new PingConnectivityChecker("http://google.com");
public void checkConnectivityToSomeHostTest() {
PingConnectivityChecker pingConnectivityChecker = new PingConnectivityChecker("google.com");
Assert.assertTrue(pingConnectivityChecker.checkConnectivity());
}
}

0 comments on commit a6714a6

Please sign in to comment.