Class PortProviderUtil

java.lang.Object
org.jboss.resteasy.utils.PortProviderUtil

public class PortProviderUtil extends Object
Utility class that provides a port number for the Resteasy embedded container.
  • Field Details

  • Constructor Details

    • PortProviderUtil

      public PortProviderUtil()
  • Method Details

    • createProxy

      public static <T> T createProxy(Class<T> clazz, String testName)
      Create a Resteasy client proxy with an empty base request path.
      Parameters:
      clazz - the client interface class
      Returns:
      the proxy object
    • createProxy

      public static <T> T createProxy(Class<T> clazz, String path, String testName)
      Create a Resteasy client proxy.
      Parameters:
      clazz - the client interface class
      path - the base request path
      Returns:
      the proxy object
    • createURI

      public static URI createURI(String path, String testName)
      Create a URI for the provided path, using the configured port
      Parameters:
      path - the request path
      Returns:
      a full URI
    • createURL

      public static URL createURL(String path, String testName) throws MalformedURLException
      Create a URL for the provided path, using the configured port
      Parameters:
      path - the request path
      Returns:
      a full URL
      Throws:
      MalformedURLException
    • generateBaseUrl

      public static String generateBaseUrl(String testName)
      Generate a base URL incorporating the configured port.
      Returns:
      a full URL
    • generateURL

      public static String generateURL(String path, String testName)
      Generate a URL incorporating the configured port.
      Parameters:
      path - the path
      testName - the test name
      Returns:
      a full URL
    • generateURL

      public static String generateURL(String path, String testName, String hostName, int port)
      Generate a URL with port, hostname
      Parameters:
      path - the path
      Returns:
      a full URL
    • getPort

      public static int getPort()
      Get port.
      Returns:
      The port number
    • getHost

      public static String getHost()
      Get host IP.
      Returns:
      The host IP
    • isIpv6

      public static boolean isIpv6()
      Get information about IPv6 connectivity.
      Returns:
      IPv6 connectivity.