public class CommonFixture extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
CommonFixture.TargetElementsIterator
An Iterator suitable for use by a "lazy" data provider.
|
| Modifier and Type | Field and Description |
|---|---|
protected com.sun.jersey.api.client.Client |
client
HTTP client component (JAX-RS Client API).
|
protected int |
conformanceLevel
The conformance level.
|
protected Document |
kmlDoc
A DOM Document representing the main KML document.
|
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).
|
protected NodeList |
targetElements
The elements to which the tests apply.
|
| 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() |
protected void |
findTargetElements(String... localNames)
Finds KML elements (of type kml:AbstractObjectType) by (local) name.
|
Document |
getResponseEntityAsDocument(com.sun.jersey.api.client.ClientResponse response,
String targetURI)
Obtains the (XML) response entity as a DOM Document.
|
void |
initCommonFixture(ITestContext testContext)
Initializes the common test fixture with a client component for
interacting with HTTP endpoints, the KML document to be tested, and the
effective conformance level.
|
void |
setTargetElements(NodeList targetElements)
Facilitates unit testing.
|
protected Iterator<Object> |
targetElementsProvider() |
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
protected Document kmlDoc
protected NodeList targetElements
protected int conformanceLevel
public void setTargetElements(NodeList targetElements)
targetElements - The collection of elements to which the tests apply.protected void findTargetElements(String... localNames)
targetId attribute.localNames - A list of KML element names.public void initCommonFixture(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).HttpClientUtils.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.HttpClientUtils.buildGetRequest(java.net.URI, java.util.Map,
javax.ws.rs.core.MediaType...)Copyright © 2016 Open Geospatial Consortium. All rights reserved.