Class AbstractUrlClient

All Implemented Interfaces:
Serializable

public abstract class AbstractUrlClient extends BaseUrlClient
Base client for Servlet tests.
See Also:
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
      The logger for this class.
    • APITEST

      protected static final String APITEST
      apitest property name
      See Also:
    • DONOTUSEServletName

      protected static final String DONOTUSEServletName
      no servlet name
      See Also:
  • Constructor Details

    • AbstractUrlClient

      protected AbstractUrlClient()
      Constructor.
  • Method Details

    • setTestProperties

      protected void setTestProperties(WebTestCase testCase)
      Description copied from class: BaseUrlClient
      Sets the appropriate test properties based on the values stored in TEST_PROPS
      Overrides:
      setTestProperties in class BaseUrlClient
      Parameters:
      testCase - a WebTestCase value
    • setServletName

      protected void setServletName(String servlet)
      Sets the name of the servlet to use when building a request for a single servlet API test.
      Parameters:
      servlet - - the name of the servlet
    • getServletName

      protected String getServletName()
      Gets the name of the servlet to use when building a request for a single servlet API test.
      Returns:
      the name of the servlet
    • getLocalInterfaceInfo

      protected String getLocalInterfaceInfo(boolean returnAddresses)
      Returns a string containing the local interface information.
      Parameters:
      returnAddresses - if true, returns IP addresses; if false, returns hostnames
      Returns:
      a string containing the local interface information
    • getRequest

      protected String getRequest(String rq)
      Returns the request string.
      Parameters:
      rq - - the request string
      Returns:
      the request string
    • getURLString

      protected String getURLString(String protocol, String hostname, int portnum, String sContext)
      Builds a url string.
      Parameters:
      protocol - - the protocol
      hostname - - the hostname
      portnum - - the port number
      sContext - - the context
      Returns:
      the url string
    • getURL

      protected URL getURL(String protocol, String hostname, int portnum, String sContext) throws MalformedURLException
      Builds a URL.
      Parameters:
      protocol - - the protocol
      hostname - - the hostname
      portnum - - the port number
      sContext - - the context
      Returns:
      the url string
      Throws:
      MalformedURLException - - if an error occurs
    • getHttpsURLConnection

      public URLConnection getHttpsURLConnection(URL newURL) throws IOException
      Opens a URLConnection.
      Parameters:
      newURL - - the URL
      Returns:
      the URLConnection
      Throws:
      IOException - - if an error occurs