Package org.opengis.cite.iso19142.locking

# Class GetFeatureWithLockTests

java.lang.Object
org.opengis.cite.iso19142.BaseFixture
org.opengis.cite.iso19142.locking.LockingFixture
org.opengis.cite.iso19142.locking.GetFeatureWithLockTests

public class GetFeatureWithLockTests extends LockingFixture
Tests the response to a GetFeatureWithLock request that attempts to lock feature instances that belong to a set of query results. The lock is active until it either expires (default duration is 300 s) or it is released by a subsequent transaction.

Sources

- ISO 19142:2010, cl. 13: GetFeatureWithLock operation
- ISO 19142:2010, cl. 13.4: Exceptions
- ISO 19142:2010, cl. 15.2.3.1.1: Declaring support for locking

- ## Field Summary

  ### Fields inherited from class org.opengis.cite.iso19142.locking.LockingFixture

  `dataSampler, locks, storedQueryId`

  ### Fields inherited from class org.opengis.cite.iso19142.BaseFixture

  `docBuilder, ETS_PKG, featureInfo, featureTypes, reqEntity, rspEntity, supportedBindings, TNS_PREFIX, wfsClient, wfsMetadata, wfsVersion`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GetFeatureWithLockTests()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `buildGetFeatureWithLockRequest()`
  Builds a DOM Document representing a GetFeatureWithLock request entity.
  `void`
  `lockAllQueryResults_20Seconds()`
  [`Test`] Submits a request to lock all instances of a randomly selected feature type for 20 seconds.
  `void`
  `lockQueryResults_hits()`
  [`Test`] The only valid value for the resultType attribute in a GetFeatureWithLock request is "results".
  `void`
  `lockSomeFeatures()`
  [`Test`] Verifies that a feature can be protected by only one lock at a time (i.e. a mutual exclusion lock).
  `void`
  `sutImplementsGetFeatureWithLock(org.testng.ITestContext testContext)`
  Checks that the GetFeatureWithLock operation is implemented by the SUT.

  ### Methods inherited from class org.opengis.cite.iso19142.locking.LockingFixture

  `initLockingFixture, releaseAllLocks`

  ### Methods inherited from class org.opengis.cite.iso19142.BaseFixture

  `addAttributesOnTestFailure, allProtocolsAndFeatureTypes, bindingAndAvailFeatureTypeProductSet, extractBodyAsDocument, getFeatureTypes, getInstantiatedFeatureTypes, getProtocolBindings, initBaseFixture, initParser, setWfsClient`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GetFeatureWithLockTests

    public GetFeatureWithLockTests()

- ## Method Details

  - ### sutImplementsGetFeatureWithLock

    @BeforeClass(alwaysRun=true) public void sutImplementsGetFeatureWithLock(org.testng.ITestContext testContext)
    Checks that the GetFeatureWithLock operation is implemented by the SUT. If not, all test methods defined in this class are skipped.
    Parameters:
      `testContext` - Supplies details about the test run.

  - ### buildGetFeatureWithLockRequest

    @BeforeMethod public void buildGetFeatureWithLockRequest()
    Builds a DOM Document representing a GetFeatureWithLock request entity. It contains default values for all lock-related attributes.

  - ### lockQueryResults_hits

    public void lockQueryResults_hits()
    [`Test`] The only valid value for the resultType attribute in a GetFeatureWithLock request is "results". Any other value ("hits") shall produce an exception report with error code "InvalidParameterValue".
    See Also:
      - "ISO 19142:2010, cl. 13.2.4.3: resultType parameter"

  - ### lockAllQueryResults_20Seconds

    public void lockAllQueryResults_20Seconds()
    [`Test`] Submits a request to lock all instances of a randomly selected feature type for 20 seconds. After this time has elapsed, an attempt is made to reset the lock; this LockFeature request should fail with a 'LockHasExpired' exception and HTTP status code 403 (Forbidden).

    Sources

    - ISO 19142:2010, cl. 12.2.4.2: lockId parameter
    - ISO 19142:2010, Table D.2

  - ### lockSomeFeatures

    public void lockSomeFeatures()
    [`Test`] Verifies that a feature can be protected by only one lock at a time (i.e. a mutual exclusion lock). Two `GetFeatureWithLock` requests are submitted:
    1. A request to lock a single feature instance for 60 seconds (Q1)
    2. A request to lock SOME of Q1 plus other feature instances (a proper superset of the Q1).

    The last request should succeed. However, the response entity shall not contain the feature that was previously locked in Q1.

    See Also:
      - "ISO 19142:2010, cl. 13.2.4.2: lockAction parameter"