Package org.opengis.cite.iso19142.basic.filter

# Class PropertyIsLikeOperatorTests

java.lang.Object
org.opengis.cite.iso19142.BaseFixture
org.opengis.cite.iso19142.basic.filter.QueryFilterFixture
org.opengis.cite.iso19142.basic.filter.PropertyIsLikeOperatorTests

public class PropertyIsLikeOperatorTests extends QueryFilterFixture
Tests the response to a GetFeature request that includes a `PropertyIsLike` filter that tests the value of a property using a specified pattern--a combination of regular characters and metacharacters. The `PropertyIsLike` predicate can be regarded as a very simple regular expression operator.

Sources

- ISO 19142:2010, cl. A.1.2: Basic WFS
- ISO 19143:2010, cl. 7.7.3.4: PropertyIsLike operator
- ISO 19143:2010, cl. A.6: Test cases for standard filter

- ## Field Summary

  ### Fields inherited from class org.opengis.cite.iso19142.basic.filter.QueryFilterFixture

  `dataSampler, GET_FEATURE_MINIMAL, model, temporalProperties`

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `(package private) void`
  `addPropertyIsLikePredicate(Document request, QName propertyName, String pattern, boolean negate)`
  Adds a `PropertyIsLike` predicate to a GetFeature request entity with the given property name and pattern.
  `(package private) Map<QName,String>`
  `generateMatchingStringPattern(QName featureType)`
  Inspects sample data retrieved from the SUT and generates a pattern that matches at least one simple property value (of type xsd:string) for the specified feature type.
  `void`
  `propertyIsLike(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a GetFeature request containing a `PropertyIsLike` predicate that applies to some simple feature property (of type xsd:string).
  `void`
  `propertyIsNotLike(ProtocolBinding binding, QName featureType)`
  [`Test`] Submits a GetFeature request containing a `Not/PropertyIsLike` predicate that applies to some simple feature property (of type xsd:string).

  ### Methods inherited from class org.opengis.cite.iso19142.basic.filter.QueryFilterFixture

  `buildRequestEntity, discardResponseEntity, findTemporalProperties, getModel, initQueryFilterFixture`

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

  - ### PropertyIsLikeOperatorTests

    public PropertyIsLikeOperatorTests()

- ## Method Details

  - ### propertyIsNotLike

    public void propertyIsNotLike(ProtocolBinding binding, QName featureType)
    [`Test`] Submits a GetFeature request containing a `Not/PropertyIsLike` predicate that applies to some simple feature property (of type xsd:string). The response entity must not include any feature instances with matching property values.
    Parameters:
      `binding` - The ProtocolBinding to use for this request.
      `featureType` - A QName representing the qualified name of some feature type.

  - ### propertyIsLike

    public void propertyIsLike(ProtocolBinding binding, QName featureType)
    [`Test`] Submits a GetFeature request containing a `PropertyIsLike` predicate that applies to some simple feature property (of type xsd:string). The response entity must include only features with a property value matching the specified pattern.
    Parameters:
      `binding` - The ProtocolBinding to use for this request.
      `featureType` - A QName representing the qualified name of some feature type.

  - ### addPropertyIsLikePredicate

    void addPropertyIsLikePredicate(Document request, QName propertyName, String pattern, boolean negate)
    Adds a `PropertyIsLike` predicate to a GetFeature request entity with the given property name and pattern. The metacharacters are shown in the following example.

         <Filter xmlns="http://www.opengis.net/fes/2.0">
           <PropertyIsLike wildCard="*" singleChar="." escapeChar="\">
             <ValueReference>tns:featureProperty</ValueReference>
             <Literal>*pattern-.</Literal>
           </PropertyIsLike>
         </Filter>

    Parameters:
      `request` - The request entity (/wfs:GetFeature).
      `propertyName` - A QName that specifies the feature property to check.
      `pattern` - The pattern to match the property value against.
      `negate` - Negates the predicate by inserting a `<Not>` operator (logical complement).

  - ### generateMatchingStringPattern

    Map<QName,String> generateMatchingStringPattern(QName featureType)
    Inspects sample data retrieved from the SUT and generates a pattern that matches at least one simple property value (of type xsd:string) for the specified feature type. If the property occurs more than once only the first occurrrence is used. Complex properties are not inspected for constituent string elements.
    Parameters:
      `featureType` - The qualified name of some feature type.
    Returns:
      A Map containing a single entry where the key is a property name and the value is a pattern (with metacharacters).