Package org.codehaus.cargo.sample.java
Class PingUtils
- java.lang.Object
-
- org.codehaus.cargo.sample.java.PingUtils
-
public final class PingUtils extends Object
Utilities to ping URLs. Useful for the tests.
-
-
Field Summary
Fields Modifier and Type Field Description static intTIMEOUTTimeout (in milliseconds)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertPing(String message, String expectedContent, URL pingURL, Map<String,String> requestProperties, boolean expectTrue, Logger errorLogger)Ping a container and check the result.static voidassertPingFalse(String message, URL pingURL, Map<String,String> requestProperties, Logger errorLogger)Ping a container and expect it to return an error.static voidassertPingFalse(String message, URL pingURL, Logger errorLogger)Ping a container and expect it to return an error.static voidassertPingTrue(String message, String expectedContent, URL pingURL, Map<String,String> requestProperties, Logger errorLogger)Ping a container and expect it to return a given content.static voidassertPingTrue(String message, String expectedContent, URL pingURL, Logger errorLogger)Ping a container and expect it to return a given content.
-
-
-
Field Detail
-
TIMEOUT
public static final int TIMEOUT
Timeout (in milliseconds)- See Also:
- Constant Field Values
-
-
Method Detail
-
assertPing
public static void assertPing(String message, String expectedContent, URL pingURL, Map<String,String> requestProperties, boolean expectTrue, Logger errorLogger)
Ping a container and check the result.- Parameters:
message- Error message.expectedContent- Expected content.pingURL- Ping URL.requestProperties- Properties for the request.expectTrue-trueif expecting the container to respond with a correct content,falseif you expect the container to return an error code.errorLogger- Logger used to log errors.
-
assertPingTrue
public static void assertPingTrue(String message, String expectedContent, URL pingURL, Map<String,String> requestProperties, Logger errorLogger)
Ping a container and expect it to return a given content.- Parameters:
message- Error message.expectedContent- Expected content.pingURL- Ping URL.requestProperties- Properties for the request.errorLogger- Logger used to log errors.
-
assertPingTrue
public static void assertPingTrue(String message, String expectedContent, URL pingURL, Logger errorLogger)
Ping a container and expect it to return a given content.- Parameters:
message- Error message.expectedContent- Expected content.pingURL- Ping URL.errorLogger- Logger used to log errors.
-
assertPingFalse
public static void assertPingFalse(String message, URL pingURL, Map<String,String> requestProperties, Logger errorLogger)
Ping a container and expect it to return an error.- Parameters:
message- Error message.requestProperties- Properties for the request.pingURL- Ping URL.errorLogger- Logger used to log errors.
-
-