Package org.opengis.cite.iso19142.transaction

# Class ReplaceTests

java.lang.Object
org.opengis.cite.iso19142.BaseFixture
org.opengis.cite.iso19142.transaction.TransactionFixture
org.opengis.cite.iso19142.transaction.ReplaceTests

public class ReplaceTests extends TransactionFixture
Tests the response to a Transaction request that includes one or more replace actions. If the WFS supports feature versioning, then the wfs:ReplaceResults element must be present (to convey the new identifiers); however, this is not currently checked.

See Also:
  - "ISO 19142:2010, cl. 15.2.6: Replace action"

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `REPL_PROPS`
  Identifier for the collection of replacement property values.

  ### Fields inherited from class org.opengis.cite.iso19142.transaction.TransactionFixture

  `dataSampler, model`

  ### 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
  `ReplaceTests()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `(package private) Element`
  `createReplacementFeature(Element originalFeature)`
  Creates a new feature representation by cloning and modifying the original instance.
  `void`
  `replaceFeature(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a Transaction request to replace an existing feature instance.
  `void`
  `restoreModifiedFeatures()`
  Restores the WFS data store to its previous state by replacing all modified features with their original representations.

  ### Methods inherited from class org.opengis.cite.iso19142.transaction.TransactionFixture

  `buildTransactionRequest, initTransactionFixture, setModel, trxTestParameters`

  ### 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`

- ## Field Details

  - ### REPL_PROPS

    public static final String REPL_PROPS
    Identifier for the collection of replacement property values.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ReplaceTests

    public ReplaceTests()

- ## Method Details

  - ### restoreModifiedFeatures

    @AfterClass public void restoreModifiedFeatures()
    Restores the WFS data store to its previous state by replacing all modified features with their original representations.

  - ### replaceFeature

    public void replaceFeature(ProtocolBinding binding, QName featureType)
    [`Test`] Submits a Transaction request to replace an existing feature instance. The test is run for all supported protocol bindings (except HTTP GET) and feature types. The response entity (wfs:TransactionResponse) must be schema-valid.
    Parameters:
      `binding` - A supported transaction request binding.
      `featureType` - A QName representing the qualified name of some feature type.
    See Also:
      - "ISO 19142:2010, cl. 15.3.3: TransactionSummary element"
      - "ISO 19142:2010, cl. 15.3.6: ReplaceResults element"

  - ### createReplacementFeature

    Element createReplacementFeature(Element originalFeature)
    Creates a new feature representation by cloning and modifying the original instance. The following standard GML properties are added (or replaced if already present):
    - gml:description ("Lorem ipsum dolor sit amet.")
    - gml:identifier (randomly generated UUID value)

    The resulting Element node will have associated user data with the key value `REPL_PROPS`. The user data are represented by a Map<XSElementDeclaration, Object> object containing a collection of property-value pairs, where each key is an element declaration denoting a property and the corresponding value is the replacement value.

    Parameters:
      `originalFeature` - The original feature instance (unmodified).
    Returns:
      A new Element node representing the modified feature.