public class CommonFixture extends Object
| 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() |
HttpURLConnection |
GetConnection(String serviceURL) |
String |
GetContentFromGETKVPRequest(String any_url,
Map<String,Object> params)
Description: Send GET request with parameters and return Response as String
|
String |
GetContentFromPOSTXMLRequest(String any_url,
Document xml_doc)
Description: Send POST request with parameters and return Response as String
|
Document |
GetDocumentTemplate(String templatePath,
String processId,
String inputId,
String outputId) |
void |
GetEchoProcessInputIdAndOutputId() |
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.
|
void |
prettyPrint(Document xmlDoc) |
String |
TransformXMLDocumentToXMLString(Document xmlDoc) |
Document |
TransformXMLFileToXMLDocument(String URI) |
Document |
TransformXMLStringToXMLDocument(String xmlString) |
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 URI ServiceUrl
protected String EchoProcessId
protected String LITERAL_INPUT_ID
protected String LITERAL_OUTPUT_ID
protected String COMPLEX_INPUT_ID
protected String COMPLEX_OUTPUT_ID
protected String GET_CAPABILITIES_REQUEST_TEMPLATE_PATH
protected String DESCRIBE_PROCESS_REQUEST_TEMPLATE_PATH
protected String LITERAL_REQUEST_TEMPLATE_PATH
protected String COMPLEX_REQUEST_TEMPLATE_PATH
protected String INPUT_VALUE_TRANSMISSION_TEMPLATE_PATH
protected String INPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH
protected String OUTPUT_VALUE_TRANSMISSION_TEMPLATE_PATH
protected String OUTPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH
protected String UNIQUE_JOB_IDS_TEMPLATE_PATH
protected String GET_STATUS_TEMPLATE_PATH
protected String GET_RESULT_TEMPLATE_PATH
public void initCommonFixture(org.testng.ITestContext testContext)
throws Exception
testContext - The test context that contains all the information for
a test run, including suite attributes.Exceptionpublic void clearMessages()
public void GetEchoProcessInputIdAndOutputId()
throws URISyntaxException,
SAXException,
IOException
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...)public String GetContentFromPOSTXMLRequest(String any_url, Document xml_doc)
any_url - xml_doc - public Document TransformXMLStringToXMLDocument(String xmlString)
xmlString - public String GetContentFromGETKVPRequest(String any_url, Map<String,Object> params)
any_url - params - public Document TransformXMLFileToXMLDocument(String URI)
URI - public String TransformXMLDocumentToXMLString(Document xmlDoc) throws Exception
xmlDoc - Exceptionpublic void prettyPrint(Document xmlDoc) throws Exception
xmlDoc - Exceptionpublic HttpURLConnection GetConnection(String serviceURL) throws IOException
IOExceptionpublic Document GetDocumentTemplate(String templatePath, String processId, String inputId, String outputId) throws URISyntaxException, SAXException, IOException
Copyright © 2023 Open Geospatial Consortium. All rights reserved.