Class 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
  • 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).