Package org.opengis.cite.cat20.dgiwg10
Class CommonFixture
java.lang.Object
org.opengis.cite.cat20.dgiwg10.CommonFixture
- Direct Known Subclasses:
GetCapabilities,GetRecordById,GetRecords,TransactionalOperation,TransactionCommon
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 DocumentA DOM document containing service metadata (OGC capabilities).protected CSWClientA client component for interacting with a WFS.protected DocumentAn HTTP request message.protected jakarta.ws.rs.core.ResponseAn HTTP response message.protected DocumentThe response document parsed from the HTTP response.static final StringRoot test suite package (absolute path). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsebuildGetRequest(URI endpoint, Map<String, String> qryParams, jakarta.ws.rs.core.MediaType... mediaTypes) Builds an HTTP request message that uses the GET method.voidgetResponseEntityAsDocument(jakarta.ws.rs.core.Response response, String targetURI) Obtains the (XML) response entity as a DOM Document.voidinitCommonFixture(org.testng.ITestContext testContext) Initializes the common test fixture with a client component for interacting with HTTP endpoints.
-
Field Details
-
ROOT_PKG_PATH
Root test suite package (absolute path).- See Also:
-
capabilitiesDoc
A DOM document containing service metadata (OGC capabilities). -
cswClient
A client component for interacting with a WFS. -
requestDocument
An HTTP request message. -
response
protected jakarta.ws.rs.core.Response responseAn HTTP response message. -
responseDocument
The response document parsed from the HTTP response.
-
-
Constructor Details
-
CommonFixture
public CommonFixture()
-
-
Method Details
-
initCommonFixture
@BeforeClass public void initCommonFixture(org.testng.ITestContext testContext) 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.
-
clearMessages
@BeforeMethod public void clearMessages() -
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:
-