public class CommonFixture extends Object
| Modifier and Type | Field and Description |
|---|---|
protected com.sun.jersey.api.client.Client |
client
HTTP client component (JAX-RS Client API).
|
protected com.sun.jersey.api.client.ClientRequest |
request
An HTTP request message.
|
protected com.sun.jersey.api.client.ClientResponse |
response
An HTTP response message.
|
static String |
ROOT_PKG_PATH
Root test suite package (absolute path).
|
| Constructor and Description |
|---|
CommonFixture() |
| Modifier and Type | Method and Description |
|---|---|
com.sun.jersey.api.client.ClientRequest |
buildGetRequest(URI endpoint,
Map<String,String> qryParams,
javax.ws.rs.core.MediaType... mediaTypes)
Builds an HTTP request message that uses the GET method.
|
void |
clearMessages() |
Document |
getResponseEntityAsDocument(com.sun.jersey.api.client.ClientResponse response,
String targetURI)
Obtains the (XML) response entity as a DOM Document.
|
void |
initCommonFixture(org.testng.ITestContext testContext)
Initializes the common test fixture with a client component for
interacting with HTTP endpoints.
|
public static final String ROOT_PKG_PATH
protected com.sun.jersey.api.client.Client client
protected com.sun.jersey.api.client.ClientRequest request
protected com.sun.jersey.api.client.ClientResponse response
public void initCommonFixture(org.testng.ITestContext testContext)
testContext - The test context that contains all the information for
a test run, including suite attributes.public void clearMessages()
public Document getResponseEntityAsDocument(com.sun.jersey.api.client.ClientResponse response, String targetURI)
response - A representation of an HTTP response message.targetURI - The target URI from which the entity was retrieved (may
be null).ClientUtils.getResponseEntityAsDocument(com.sun.jersey.api.client.ClientResponse, java.lang.String)public com.sun.jersey.api.client.ClientRequest buildGetRequest(URI endpoint, Map<String,String> qryParams, javax.ws.rs.core.MediaType... mediaTypes)
endpoint - A URI indicating the target resource.qryParams - A Map containing query parameters (may be null);mediaTypes - A list of acceptable media types; if not specified,
generic XML ("application/xml") is preferred.ClientUtils.buildGetRequest(java.net.URI, java.util.Map<java.lang.String, java.lang.String>, javax.ws.rs.core.MediaType...)Copyright © 2023 Open Geospatial Consortium. All rights reserved.