Class CommonFixture

java.lang.Object
org.opengis.cite.wps20.CommonFixture
Direct Known Subclasses:
AsyncTests, BasicTests, SyncTests

public class CommonFixture extends Object
A supporting base class that sets up a common test fixture. These configuration methods are invoked before those defined in a subclass.
  • Field Details

    • ROOT_PKG_PATH

      public static final String ROOT_PKG_PATH
      Root test suite package (absolute path).
      See Also:
    • client

      protected jakarta.ws.rs.client.Client client
      HTTP client component (JAX-RS Client API).
    • request

      protected org.glassfish.jersey.client.ClientRequest request
      An HTTP request message.
    • response

      protected jakarta.ws.rs.core.Response response
      An HTTP response message.
    • ServiceUrl

      protected URI ServiceUrl
    • EchoProcessId

      protected String EchoProcessId
    • LITERAL_INPUT_ID

      protected String LITERAL_INPUT_ID
    • LITERAL_OUTPUT_ID

      protected String LITERAL_OUTPUT_ID
    • COMPLEX_INPUT_ID

      protected String COMPLEX_INPUT_ID
    • COMPLEX_OUTPUT_ID

      protected String COMPLEX_OUTPUT_ID
    • GET_CAPABILITIES_REQUEST_TEMPLATE_PATH

      protected String GET_CAPABILITIES_REQUEST_TEMPLATE_PATH
    • DESCRIBE_PROCESS_REQUEST_TEMPLATE_PATH

      protected String DESCRIBE_PROCESS_REQUEST_TEMPLATE_PATH
    • LITERAL_REQUEST_TEMPLATE_PATH

      protected String LITERAL_REQUEST_TEMPLATE_PATH
    • COMPLEX_REQUEST_TEMPLATE_PATH

      protected String COMPLEX_REQUEST_TEMPLATE_PATH
    • INPUT_VALUE_TRANSMISSION_TEMPLATE_PATH

      protected String INPUT_VALUE_TRANSMISSION_TEMPLATE_PATH
    • INPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH

      protected String INPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH
    • OUTPUT_VALUE_TRANSMISSION_TEMPLATE_PATH

      protected String OUTPUT_VALUE_TRANSMISSION_TEMPLATE_PATH
    • OUTPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH

      protected String OUTPUT_REFERENCE_TRANSMISSION_TEMPLATE_PATH
    • UNIQUE_JOB_IDS_TEMPLATE_PATH

      protected String UNIQUE_JOB_IDS_TEMPLATE_PATH
    • GET_STATUS_TEMPLATE_PATH

      protected String GET_STATUS_TEMPLATE_PATH
    • GET_RESULT_TEMPLATE_PATH

      protected String GET_RESULT_TEMPLATE_PATH
  • Constructor Details

    • CommonFixture

      public CommonFixture()
  • Method Details

    • initCommonFixture

      @BeforeClass public void initCommonFixture(org.testng.ITestContext testContext) throws Exception
      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

      public void GetEchoProcessInputIdAndOutputId() throws URISyntaxException, SAXException, IOException

      GetEchoProcessInputIdAndOutputId.

      Throws:
      URISyntaxException - if any.
      SAXException - if any.
      IOException - if any.
    • getResponseEntityAsDocument

      public Document getResponseEntityAsDocument(jakarta.ws.rs.core.Response response, String targetURI)
      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

      public String GetContentFromPOSTXMLRequest(String any_url, Document xml_doc)
      Description: Send POST request with parameters and return Response as String
      Parameters:
      any_url - a String object
      xml_doc - a Document object
      Returns:
      a String object
    • TransformXMLStringToXMLDocument

      public Document TransformXMLStringToXMLDocument(String xmlString)

      TransformXMLStringToXMLDocument.

      Parameters:
      xmlString - a String object
      Returns:
      a Document object
    • GetContentFromGETKVPRequest

      public String GetContentFromGETKVPRequest(String any_url, Map<String,Object> params)
      Description: Send GET request with parameters and return Response as String
      Parameters:
      any_url - a String object
      params - a Map object
      Returns:
      a String object
    • TransformXMLFileToXMLDocument

      public Document TransformXMLFileToXMLDocument(String URI)

      TransformXMLFileToXMLDocument.

      Parameters:
      URI - a String object
      Returns:
      a Document object
    • TransformXMLDocumentToXMLString

      public String TransformXMLDocumentToXMLString(Document xmlDoc) throws Exception

      TransformXMLDocumentToXMLString.

      Parameters:
      xmlDoc - a Document object
      Returns:
      a String object
      Throws:
      Exception
    • prettyPrint

      public void prettyPrint(Document xmlDoc) throws Exception

      prettyPrint.

      Parameters:
      xmlDoc - a Document object
      Throws:
      Exception
    • GetConnection

      public HttpURLConnection GetConnection(String serviceURL) throws IOException

      GetConnection.

      Parameters:
      serviceURL - a String 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 - a String object
      processId - a String object
      inputId - a String object
      outputId - a String object
      Returns:
      a Document object
      Throws:
      URISyntaxException - if any.
      SAXException - if any.
      IOException - if any.