Package org.opengis.cite.wps20
Class CommonFixture
java.lang.Object
org.opengis.cite.wps20.CommonFixture
- Direct Known Subclasses:
AsyncTests
,BasicTests
,SyncTests
A supporting base class that sets up a common test fixture. These configuration methods
are invoked before those defined in a subclass.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.ws.rs.client.Client
HTTP client component (JAX-RS Client API).protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected org.glassfish.jersey.client.ClientRequest
An HTTP request message.protected jakarta.ws.rs.core.Response
An HTTP response message.static final String
Root test suite package (absolute path).protected URI
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
buildGetRequest
(URI endpoint, Map<String, String> qryParams, jakarta.ws.rs.core.MediaType... mediaTypes) Builds an HTTP request message that uses the GET method.void
clearMessages.GetConnection
(String serviceURL) GetConnection.GetContentFromGETKVPRequest
(String any_url, Map<String, Object> params) Description: Send GET request with parameters and return Response as StringGetContentFromPOSTXMLRequest
(String any_url, Document xml_doc) Description: Send POST request with parameters and return Response as StringGetDocumentTemplate
(String templatePath, String processId, String inputId, String outputId) GetDocumentTemplate.void
GetEchoProcessInputIdAndOutputId.getResponseEntityAsDocument
(jakarta.ws.rs.core.Response 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) prettyPrint.TransformXMLDocumentToXMLString.TransformXMLFileToXMLDocument.TransformXMLStringToXMLDocument
(String xmlString) TransformXMLStringToXMLDocument.
-
Field Details
-
ROOT_PKG_PATH
Root test suite package (absolute path).- See Also:
-
client
protected jakarta.ws.rs.client.Client clientHTTP client component (JAX-RS Client API). -
request
protected org.glassfish.jersey.client.ClientRequest requestAn HTTP request message. -
response
protected jakarta.ws.rs.core.Response responseAn HTTP response message. -
ServiceUrl
-
EchoProcessId
-
LITERAL_INPUT_ID
-
LITERAL_OUTPUT_ID
-
COMPLEX_INPUT_ID
-
COMPLEX_OUTPUT_ID
-
GET_CAPABILITIES_REQUEST_TEMPLATE_PATH
-
DESCRIBE_PROCESS_REQUEST_TEMPLATE_PATH
-
LITERAL_REQUEST_TEMPLATE_PATH
-
COMPLEX_REQUEST_TEMPLATE_PATH
-
INPUT_VALUE_TRANSMISSION_TEMPLATE_PATH
-
INPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH
-
OUTPUT_VALUE_TRANSMISSION_TEMPLATE_PATH
-
OUTPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH
-
UNIQUE_JOB_IDS_TEMPLATE_PATH
-
GET_STATUS_TEMPLATE_PATH
-
GET_RESULT_TEMPLATE_PATH
-
-
Constructor Details
-
CommonFixture
public CommonFixture()
-
-
Method Details
-
initCommonFixture
Initializes the common test fixture with a client component for interacting with HTTP endpoints.- Parameters:
testContext
- The test context that contains all the information for a test run, including suite attributes.- Throws:
Exception
- if any.
-
clearMessages
@BeforeMethod public void clearMessages()clearMessages.
-
GetEchoProcessInputIdAndOutputId
GetEchoProcessInputIdAndOutputId.
- Throws:
URISyntaxException
- if any.SAXException
- if any.IOException
- if any.
-
getResponseEntityAsDocument
Obtains the (XML) response entity as a DOM Document. This convenience method wraps a static method call to facilitate unit testing (Mockito workaround).- Parameters:
response
- A representation of an HTTP response message.targetURI
- The target URI from which the entity was retrieved (may be null).- Returns:
- A Document representing the entity.
- See Also:
-
buildGetRequest
public jakarta.ws.rs.core.Response buildGetRequest(URI endpoint, Map<String, String> qryParams, jakarta.ws.rs.core.MediaType... mediaTypes) Builds an HTTP request message that uses the GET method. This convenience method wraps a static method call to facilitate unit testing (Mockito workaround).- Parameters:
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.- Returns:
- A Response object.
- See Also:
-
GetContentFromPOSTXMLRequest
Description: Send POST request with parameters and return Response as String -
TransformXMLStringToXMLDocument
TransformXMLStringToXMLDocument.
-
GetContentFromGETKVPRequest
Description: Send GET request with parameters and return Response as String -
TransformXMLFileToXMLDocument
TransformXMLFileToXMLDocument.
-
TransformXMLDocumentToXMLString
TransformXMLDocumentToXMLString.
-
prettyPrint
prettyPrint.
-
GetConnection
GetConnection.
- Parameters:
serviceURL
- aString
object- Returns:
- a
HttpURLConnection
object - Throws:
IOException
- if any.
-
GetDocumentTemplate
public Document GetDocumentTemplate(String templatePath, String processId, String inputId, String outputId) throws URISyntaxException, SAXException, IOException GetDocumentTemplate.
- Parameters:
templatePath
- aString
objectprocessId
- aString
objectinputId
- aString
objectoutputId
- aString
object- Returns:
- a
Document
object - Throws:
URISyntaxException
- if any.SAXException
- if any.IOException
- if any.
-