public class TestPortProvider
extends java.lang.Object
Constructor and Description |
---|
TestPortProvider() |
Modifier and Type | Method and Description |
---|---|
static ClientRequest |
createClientRequest(ClientRequestFactory factory,
java.lang.String path) |
static ClientRequest |
createClientRequest(java.lang.String path)
Create a Resteasy ClientRequest object using the configured port.
|
static <T> T |
createProxy(java.lang.Class<T> clazz)
Create a Resteasy client proxy with an empty base request path.
|
static <T> T |
createProxy(java.lang.Class<T> clazz,
java.lang.String path)
Create a Resteasy client proxy.
|
static java.net.URI |
createURI(java.lang.String path)
Create a URI for the provided path, using the configured port
|
static java.net.URL |
createURL(java.lang.String path)
Create a URL for the provided path, using the configured port
|
static java.lang.String |
generateBaseUrl()
Generate a base URL incorporating the configured port.
|
static java.lang.String |
generateURL(java.lang.String path)
Generate a URL incorporating the configured port.
|
static java.lang.String |
getHost()
Look up the configured hostname, first checking an environment variable (RESTEASY_HOST),
then a system property (org.jboss.resteasy.host), and finally the default hostname (localhost).
|
static int |
getPort()
Look up the configured port number, first checking an environment variable (RESTEASY_PORT),
then a system property (org.jboss.resteasy.port), and finally the default port (8081).
|
public static ClientRequest createClientRequest(java.lang.String path)
path
- the request pathpublic static ClientRequest createClientRequest(ClientRequestFactory factory, java.lang.String path)
public static <T> T createProxy(java.lang.Class<T> clazz)
clazz
- the client interface classpublic static <T> T createProxy(java.lang.Class<T> clazz, java.lang.String path)
clazz
- the client interface classpublic static java.net.URI createURI(java.lang.String path)
path
- the request pathpublic static java.net.URL createURL(java.lang.String path) throws java.net.MalformedURLException
path
- the request pathjava.net.MalformedURLException
public static java.lang.String generateBaseUrl()
public static java.lang.String generateURL(java.lang.String path)
path
- the pathpublic static int getPort()
public static java.lang.String getHost()