Class PingUtils


  • public class PingUtils
    extends junit.framework.Assert
    Utilities to ping URLs. Useful for the tests.
    • Constructor Summary

      Constructors 
      Constructor Description
      PingUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertPing​(String message, String expectedContent, URL pingURL, Map<String,​String> requestProperties, boolean expectTrue, Logger errorLogger)
      Ping a container and check the result.
      static void assertPingFalse​(String message, String expectedContent, URL pingURL, Logger errorLogger)
      Ping a container and expect it to return an error.
      static void assertPingFalse​(String message, URL pingURL, Logger errorLogger)
      Ping a container and expect it to return an error.
      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.
      static void assertPingTrue​(String message, String expectedContent, URL pingURL, Logger errorLogger)
      Ping a container and expect it to return a given content.
      static void assertPingTrue​(String message, URL pingURL, Logger errorLogger)
      Ping a container and expect it to return any content.
      • Methods inherited from class junit.framework.Assert

        assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
    • Constructor Detail

      • PingUtils

        public PingUtils()
    • 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 - true if expecting the container to respond with a correct content, false if 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,
                                           String expectedContent,
                                           URL pingURL,
                                           Logger errorLogger)
        Ping a container and expect it to return an error.
        Parameters:
        message - Error message.
        expectedContent - Expected content.
        pingURL - Ping URL.
        errorLogger - Logger used to log errors.
      • assertPingTrue

        public static void assertPingTrue​(String message,
                                          URL pingURL,
                                          Logger errorLogger)
        Ping a container and expect it to return any content.
        Parameters:
        message - Error message.
        pingURL - Ping URL.
        errorLogger - Logger used to log errors.
      • assertPingFalse

        public static void assertPingFalse​(String message,
                                           URL pingURL,
                                           Logger errorLogger)
        Ping a container and expect it to return an error.
        Parameters:
        message - Error message.
        pingURL - Ping URL.
        errorLogger - Logger used to log errors.