Class LockFeatureTests


public class LockFeatureTests extends LockingFixture
Tests the response to a LockFeature request that attempts to lock feature instances identified using one or more query expressions. A 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. 12: LockFeature operation
  • ISO 19142:2010, cl. 12.4: Exceptions
  • ISO 19142:2010, cl. 15.2.3.1.1: Declaring support for locking
  • Constructor Details

    • LockFeatureTests

      public LockFeatureTests()
  • Method Details

    • buildSimpleLockFeatureRequest

      @BeforeMethod public void buildSimpleLockFeatureRequest()
      Builds a DOM Document representing a LockFeature request entity.
    • lockFeatureAndAttemptDelete

      public void lockFeatureAndAttemptDelete()
      [Test] Submits a request to lock a feature instance; within this interval an attempt to delete the instance without the correct lock identifier should fail with exception code MissingParameterValue.

      Sources

      • ISO 19142:2010, cl. 12.2.4.3: Lock expiry parameter
      • ISO 19142:2010, cl. 15.2.3.1.2: lockId parameter
    • lockFeatureAlreadyLocked

      public void lockFeatureAlreadyLocked()
      [Test] A feature instance may be locked by only one lock. An attempt to establish another lock should fail with exception code CannotLockAllFeatures if lockAction = "ALL" (the default value).

      Sources

      • ISO 19142:2010, Table 18: Keywords for LockFeature KVP encoding
      • ISO 19142:2010, cl. 12.2.5: State machine for WFS locking
    • lockAllFeaturesByType

      public void lockAllFeaturesByType(ProtocolBinding binding, QName featureType)
      [Test] Locks all feature instances of a given type using default values for all locking options. If no data exist for a given feature type it is skipped. The response entity must include a lockId attribute and the wfs:FeaturesLocked element. The wfs:FeatureNotLocked element must not be present.

      Sources

      • ISO 19142:2010, cl. 12.3.2: XML-encoding
      Parameters:
      binding - The ProtocolBinding to use for the request.
      featureType - A QName object denoting the feature type name.
    • lockFeatureWithLockIdAndQuery

      public void lockFeatureWithLockIdAndQuery()
      [Test] An attempt to reset a lock with locKId and fes:AbstractQueryExpression should produce a service exception with error code "OperationParsingFailed" and HTTP status code 400 (Bad Request).

      Note: The WFS 2.0.2 specification specifies this behaviour in detail (12.2.4.2 lockId parameter): "If both a lockId parameter and one or more fes:AbstractQueryExpression elements are included in a LockFeature request then the server shall raise an OperationParsingFailed exception (see 7.5).[24]"

      Sources

      • 09-025r2, cl. 12.2.4.2: lockId parameter
      • 09-025r2, Table D.2