public class CommonFixture extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Schema |
atomSchema
An immutable Schema object for validating Atom feeds/entries (RFC 4287,
Appendix B).
|
protected com.sun.jersey.api.client.Client |
client
HTTP client component (JAX-RS Client API).
|
protected Document |
cswCapabilities
Service capabilities document (csw:Capabilities).
|
protected Schema |
cswSchema
An immutable Schema object for validating all CSW 3.0 messages
(cswAll.xsd).
|
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).
|
static String |
SCHEMATRON_ATOM
Classpath reference for Schematron schema (Atom feed).
|
| 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 the following objects:
a client component for interacting with HTTP endpoints
the CSW message schema (obtained from the suite attribute
SuiteAttribute.CSW_SCHEMA, a thread-safe
Schema object).
the Atom schema (obtained from the suite attribute
SuiteAttribute.ATOM_SCHEMA, a thread-safe
Schema object).
the service capabilities document (obtained from the suite attribute
SuiteAttribute.TEST_SUBJECT, which should
evaluate to a DOM Document node).
|
public static final String ROOT_PKG_PATH
public static final String SCHEMATRON_ATOM
protected com.sun.jersey.api.client.Client client
protected Document cswCapabilities
protected Schema cswSchema
protected Schema atomSchema
protected com.sun.jersey.api.client.ClientRequest request
protected com.sun.jersey.api.client.ClientResponse response
public void initCommonFixture(org.testng.ITestContext testContext)
SuiteAttribute.CSW_SCHEMA, a thread-safe
Schema object).SuiteAttribute.ATOM_SCHEMA, a thread-safe
Schema object).SuiteAttribute.TEST_SUBJECT, which should
evaluate to a DOM Document node).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,
javax.ws.rs.core.MediaType...)Copyright © 2018 Open Geospatial Consortium. All rights reserved.