NetworkAssert

public class NetworkAssert

The NetworkAssert is

Author:Twinsen Tsang

Methods

assertSocketNonReachable

public static void assertSocketNonReachable(String host, int port, int timeout)

Assert whether the server socket with host and port is reachable with the time limit timeout.

Parameters:
  • message – The customized error message when the assertion failed.
  • host – The host of the server socket binds to.
  • port – The port of the server socket binds to .
  • timeout – How long does this assert think it is time out, ie failed to connect.

assertSocketNonReachable

public static void assertSocketNonReachable(String message, String host, int port, int timeout)

Assert whether the server socket with host and port is reachable with the time limit timeout.

Parameters:
  • host – The host of the server socket binds to.
  • port – The port of the server socket binds to .
  • timeout – How long does this assert think it is time out, ie failed to connect.

assertSocketReachable

public static void assertSocketReachable(String host, int port, int timeout)

Assert whether the server socket with host and port is reachable with the time limit timeout.

Parameters:
  • host – The host of the server socket binds to.
  • port – The port of the server socket binds to .
  • timeout – How long does this assert think it is time out, ie failed to connect.

assertSocketReachable

public static void assertSocketReachable(String message, String host, int port, int timeout)

Assert whether the server socket with host and port is reachable with the time limit timeout.

Parameters:
  • message – The customized error message when the assertion failed.
  • host – The host of the server socket binds to.
  • port – The port of the server socket binds to .
  • timeout – How long does this assert think it is time out, ie failed to connect.