public class ComparisonOperatorTests extends QueryFilterFixture
These operators compare the value of a simple property against some specified
value; they can be applied to numeric, temporal, and text data types
(although lexicographic order may depend on the collation rules). If a
property has multiple values, the matchAction parameter affects the
scope of the comparison ("All", "Any", "One").
Sources
dataSampler, GET_FEATURE_MINIMAL, model, temporalPropertiesdocBuilder, ETS_PKG, featureInfo, featureTypes, reqEntity, rspEntity, supportedBindings, TNS_PREFIX, wfsClient, wfsMetadata, wfsVersion| Constructor and Description |
|---|
ComparisonOperatorTests() |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addComparisonPredicate(Document request,
String operator,
QName propertyName,
Object literalValue,
boolean matchCase,
String matchAction)
Adds a comparison predicate to a GetFeature request entity with the given
property name and literal value.
|
(package private) String[] |
calculateRange(String[] values,
QName datatype)
Calculates the range of the given values and returns the minimum and
maximum values as valid string literals.
|
(package private) Map<org.apache.xerces.xs.XSElementDeclaration,String[]> |
findFeaturePropertyValue(org.apache.xerces.xs.XSModel model,
QName featureType,
Set<org.apache.xerces.xs.XSTypeDefinition> dataTypes)
Inspects sample data retrieved from the SUT and determines the range of
simple property values for the specified feature type.
|
(package private) Set<org.apache.xerces.xs.XSTypeDefinition> |
getNumericDataTypes(org.apache.xerces.xs.XSModel model)
Returns a set of primitive numeric data type definitions (xsd:decimal,
xsd:double, xsd:float).
|
void |
invalidOperand_boundedBy(ProtocolBinding binding)
[
Test] Submits a GetFeature request containing a comparison
filter predicate that refers to the complex feature property
gml:boundedBy (with fes:Literal/gml:Envelope as the literal operand). |
void |
invalidPropertyReference(ProtocolBinding binding)
[
Test] Submits a GetFeature request containing a comparison
filter predicate that refers to an invalid feature property. |
void |
propertyIsGreaterThan_matchAny(ProtocolBinding binding,
QName featureType)
[
Test] Submits a GetFeature request containing a
PropertyIsGreaterThan predicate that applies to some simple
(numeric or temporal) feature property. |
void |
propertyIsGreaterThanEqualTo_matchAny(ProtocolBinding binding,
QName featureType)
[
Test] Submits a GetFeature request containing a
PropertyIsGreaterThanOrEqualTo predicate that applies to some
simple (numeric or temporal) feature property. |
void |
propertyIsLessThan_matchAll(ProtocolBinding binding,
QName featureType)
[
Test] Submits a GetFeature request containing a
PropertyIsLessThan predicate that applies to some simple (numeric
or temporal) feature property. |
void |
propertyIsLessThan_matchAny(ProtocolBinding binding,
QName featureType)
[
Test] Submits a GetFeature request containing a
PropertyIsLessThan predicate that applies to some simple (numeric
or temporal) feature property. |
void |
propertyIsLessThanEqualTo_matchAny(ProtocolBinding binding,
QName featureType)
[
Test] Submits a GetFeature request containing a
PropertyIsLessThanOrEqualTo predicate that applies to some simple
(numeric or temporal) feature property. |
(package private) void |
sortValues(String[] values)
Sorts the given array into ascending order, assuming its elements
represent either numeric (Double) or temporal (Calendar) values.
|
buildRequestEntity, discardResponseEntity, findTemporalProperties, initQueryFilterFixtureaddAttributesOnTestFailure, allProtocolsAndFeatureTypes, bindingAndAvailFeatureTypeProductSet, extractBodyAsDocument, getFeatureTypes, getInstantiatedFeatureTypes, getProtocolBindings, initBaseFixture, initParser, setWfsClientpublic void propertyIsLessThan_matchAny(ProtocolBinding binding, QName featureType)
Test] Submits a GetFeature request containing a
PropertyIsLessThan predicate that applies to some simple (numeric
or temporal) feature property. The response entity must include only
feature instances that satisfy the predicate; if multiple values exist,
at least one must match (matchAction="Any").binding - The ProtocolBinding to use for this request.featureType - A QName representing the qualified name of some feature type.public void propertyIsLessThan_matchAll(ProtocolBinding binding, QName featureType)
Test] Submits a GetFeature request containing a
PropertyIsLessThan predicate that applies to some simple (numeric
or temporal) feature property. The response entity must include only
feature instances that satisfy the predicate; if multiple values exist,
all of them must match (matchAction="All").binding - The ProtocolBinding to use for this request.featureType - A QName representing the qualified name of some feature type.public void propertyIsGreaterThan_matchAny(ProtocolBinding binding, QName featureType)
Test] Submits a GetFeature request containing a
PropertyIsGreaterThan predicate that applies to some simple
(numeric or temporal) feature property. The response entity must include
only feature instances that satisfy the predicate; if multiple values
exist, at least one must match (matchAction="Any").binding - The ProtocolBinding to use for this request.featureType - A QName representing the qualified name of some feature type.public void propertyIsGreaterThanEqualTo_matchAny(ProtocolBinding binding, QName featureType)
Test] Submits a GetFeature request containing a
PropertyIsGreaterThanOrEqualTo predicate that applies to some
simple (numeric or temporal) feature property. The response entity must
include only feature instances that satisfy the predicate; if multiple
values exist, at least one must match (matchAction="Any").binding - The ProtocolBinding to use for this request.featureType - A QName representing the qualified name of some feature type.public void propertyIsLessThanEqualTo_matchAny(ProtocolBinding binding, QName featureType)
Test] Submits a GetFeature request containing a
PropertyIsLessThanOrEqualTo predicate that applies to some simple
(numeric or temporal) feature property. The response entity must include
only feature instances that satisfy the predicate; if multiple values
exist, at least one must match (matchAction="Any").binding - The ProtocolBinding to use for this request.featureType - A QName representing the qualified name of some feature type.public void invalidPropertyReference(ProtocolBinding binding)
Test] Submits a GetFeature request containing a comparison
filter predicate that refers to an invalid feature property. An exception
report is expected in response with status code 400 and exception code
InvalidParameterValue.binding - The ProtocolBinding to use for this request.public void invalidOperand_boundedBy(ProtocolBinding binding)
Test] Submits a GetFeature request containing a comparison
filter predicate that refers to the complex feature property
gml:boundedBy (with fes:Literal/gml:Envelope as the literal operand).
An exception report is expected in response with exception code
OperationProcessingFailed and status code 400 or 403.
Sources
binding - The ProtocolBinding to use for this request.void addComparisonPredicate(Document request, String operator, QName propertyName, Object literalValue, boolean matchCase, String matchAction)
<Filter xmlns="http://www.opengis.net/fes/2.0">
<PropertyIsLessThan matchCase="true" matchAction="Any">
<Literal>value</Literal>
<ValueReference>tns:featureProperty</ValueReference>
</PropertyIsLessThan>
</Filter>
request - The request entity (/wfs:GetFeature).operator - The name of the comparison operator.propertyName - A QName that specifies the feature property to check.literalValue - The literal object to compare the property value with; it must
be a String or a DOM Document (in which case the document
element is used to represent a complex literal).matchCase - A boolean value indicating whether or not the comparison
should be case-sensitive.matchAction - A String specifying how the predicate should be applied to a
multi-valued property; the default value is "Any".Map<org.apache.xerces.xs.XSElementDeclaration,String[]> findFeaturePropertyValue(org.apache.xerces.xs.XSModel model, QName featureType, Set<org.apache.xerces.xs.XSTypeDefinition> dataTypes)
model - An XSModel object representing an application schema.featureType - The qualified name of some feature type.dataTypes - A Set of simple data types that possess an interval or ratio
scale of measurement (e.g. numeric or temporal data types).String[] array containing
two String objects representing the minimum and maximum values of
the property.String[] calculateRange(String[] values, QName datatype)
values - An array of strings representing numeric or temporal values.datatype - The name of the built-in XML Schema datatype to which the
values must conform.void sortValues(String[] values)
values - An array containing String representations of numeric or
temporal values.Set<org.apache.xerces.xs.XSTypeDefinition> getNumericDataTypes(org.apache.xerces.xs.XSModel model)
model - An XSModel object representing an application schema.Copyright © 2020 Open Geospatial Consortium. All rights reserved.