Package org.opengis.cite.iso19142
Class BaseFixture
java.lang.Object
org.opengis.cite.iso19142.BaseFixture
- Direct Known Subclasses:
BasicCapabilitiesTests
,BasicGetFeatureTests
,CreateStoredQueryTests
,DescribeFeatureTypeTests
,DescribeStoredQueriesTests
,DropStoredQueryTests
,GetPropertyValueTests
,ListStoredQueriesTests
,LockingCapabilitiesTests
,LockingFixture
,PagingTests
,QueryFilterFixture
,ServiceMetadataTests
,SimpleCapabilitiesTests
,StoredQueryTests
,TransactionCapabilitiesTests
,TransactionFixture
,VersioningTests
A supporting base class that provides common configuration methods and data providers.
The configuration methods are invoked before any that may be defined in a subclass.
-
Field Summary
Modifier and TypeFieldDescriptionprotected DocumentBuilder
A DOM parser.protected static final String
Root ETS package.protected Map<QName,
FeatureTypeInfo> protected Document
A Document representing the content of the request message.protected Document
A Document representing the content of the response message.protected Set<ProtocolBinding>
protected static final String
protected WFSClient
A client component for interacting with a WFS.protected Document
A DOM document containing service metadata (OGC capabilities).protected String
Highest version supported by the IUT. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttributesOnTestFailure
(org.testng.ITestResult result) Augments the test result with supplementary attributes in the event that a test method failed.A DataProvider that supplies parameters specifying a supported protocol binding and a feature type.bindingAndAvailFeatureTypeProductSet
(org.testng.ITestContext testContext) A DataProvider that supplies a collection of parameter tuples (a product set) where each tuple has two elements: ProtocolBinding - a supported request binding QName - the name of a feature type for which data are availableprotected Document
extractBodyAsDocument
(jakarta.ws.rs.core.Response rsp) Extracts the body of the response message as a DOM Document node.Object[][]
A DataProvider that supplies the complete set of feature types recognized by the SUT.A DataProvider that supplies feature type names for which instances exist.Object[][]
getProtocolBindings
(org.testng.ITestContext testContext) A DataProvider that supplies the set of application protocol bindings supported by the SUT.void
initBaseFixture
(org.testng.ITestContext testContext) Sets up the base fixture.void
Initializes the (namespace-aware) DOM parser.void
setWfsClient
(WFSClient wfsClient)
-
Field Details
-
ETS_PKG
Root ETS package.- See Also:
-
wfsMetadata
A DOM document containing service metadata (OGC capabilities). -
wfsClient
A client component for interacting with a WFS. -
supportedBindings
-
featureTypes
-
featureInfo
-
docBuilder
A DOM parser. -
TNS_PREFIX
- See Also:
-
reqEntity
A Document representing the content of the request message. -
rspEntity
A Document representing the content of the response message. -
wfsVersion
Highest version supported by the IUT.
-
-
Constructor Details
-
BaseFixture
public BaseFixture()
-
-
Method Details
-
setWfsClient
-
initBaseFixture
@BeforeClass(alwaysRun=true) public void initBaseFixture(org.testng.ITestContext testContext) Sets up the base fixture. The service metadata document is obtained from the ISuite context. The suite attributetestSubject
should yield a DOM Document node having {http://www.opengis.net/wfs/2.0}WFS_Capabilities as the document element. The set of implemented protocol bindings is determined from the service metadata by checking the values of the following service constraints:- KVPEncoding
- XMLEncoding
- SOAPEncoding
- Parameters:
testContext
- The test (set) context.
-
initParser
@BeforeClass public void initParser()Initializes the (namespace-aware) DOM parser. -
addAttributesOnTestFailure
@AfterMethod public void addAttributesOnTestFailure(org.testng.ITestResult result) Augments the test result with supplementary attributes in the event that a test method failed. The "request" attribute contains a String representing the request entity (POST method) or query component (GET method). The "response" attribute contains the content of the response entity.- Parameters:
result
- A description of the test result.
-
getProtocolBindings
@DataProvider(name="protocol-binding") public Object[][] getProtocolBindings(org.testng.ITestContext testContext) A DataProvider that supplies the set of application protocol bindings supported by the SUT.- Parameters:
testContext
- Supplies details about the test run.- Returns:
- An Object[][] array containing a ProtocolBinding object in each row (first dimension).
-
getFeatureTypes
A DataProvider that supplies the complete set of feature types recognized by the SUT.- Returns:
- An Object[][] array containing a QName object in each row (first dimension).
-
getInstantiatedFeatureTypes
@DataProvider(name="instantiated-feature-types") public Iterator<Object[]> getInstantiatedFeatureTypes()A DataProvider that supplies feature type names for which instances exist.- Returns:
- An Iterator over an array containing a QName object representing the qualified name of a feature type.
-
allProtocolsAndFeatureTypes
@DataProvider(name="all-protocols-featureTypes") public Iterator<Object[]> allProtocolsAndFeatureTypes()A DataProvider that supplies parameters specifying a supported protocol binding and a feature type. The resulting set is given by the Cartesian product of the sets {bindings} x {featureTypes}; its cardinality is equal to the product of the cardinalities of the two input sets.- Returns:
- An Iterator<Object[]> over the set of (ProtocolBinding, QName) pairs.
-
bindingAndAvailFeatureTypeProductSet
@DataProvider(name="protocol-featureType") public Iterator<Object[]> bindingAndAvailFeatureTypeProductSet(org.testng.ITestContext testContext) A DataProvider that supplies a collection of parameter tuples (a product set) where each tuple has two elements:- ProtocolBinding - a supported request binding
- QName - the name of a feature type for which data are available
- Parameters:
testContext
- The ITestContext object for the test run.- Returns:
- Iterator<Object[]> An iterator over a collection of parameter tuples (ProtocolBinding, QName).
-
extractBodyAsDocument
Extracts the body of the response message as a DOM Document node. For a SOAP response this will contain the content of the SOAP body element.- Parameters:
rsp
- A Response representing an HTTP response message.- Returns:
- A Document representing the response entity, or
null
if it could not be parsed.
-