public class RelationalOperatorTests 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").
dataSampler, GET_FEATURE_ENTITY, model
docBuilder, featureInfo, featureTypes, reqEntity, rspEntity, supportedBindings, TNS_PREFIX, wfsClient, wfsMetadata
Constructor and Description |
---|
RelationalOperatorTests() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addRelationalPredicate(Document request,
String operator,
QName propertyName,
Object literalValue,
boolean matchCase,
String matchAction)
Adds a relational predicate to a GetFeature request entity with the given
property name and literal value.
|
(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).
|
(package private) Set<org.apache.xerces.xs.XSTypeDefinition> |
getTemporalDataTypes(org.apache.xerces.xs.XSModel model)
Returns a set of primitive, non-recurring temporal data type definitions,
including:
xsd:dateTime ("yyyy-MM-dd'T'HH:mm:ssZ")
xsd:date ("yyyy-MM-ddZ")
xsd:gYearMonth ("yyyy-MM")
xsd:gYear ("yyyy")
|
void |
invalidOperand_boundedBy(ProtocolBinding binding)
[
Test ] Submits a GetFeature request containing a relational
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 relational
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, initQueryFilterFixture
addAttributesOnTestFailure, allProtocolsAndFeatureTypes, bindingAndAvailFeatureTypeProductSet, extractBodyAsDocument, getFeatureTypes, getInstantiatedFeatureTypes, getProtocolBindings, initBaseFixture, initParser
public 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 relational
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 relational
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 status code 400 and
exception code OperationProcessingFailed
, since the operator
cannot be applied to this complex property.
binding
- The ProtocolBinding to use for this request.void addRelationalPredicate(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 relational 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.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.Set<org.apache.xerces.xs.XSTypeDefinition> getTemporalDataTypes(org.apache.xerces.xs.XSModel model)
model
- An XSModel object representing an application schema.Copyright © 2013. All Rights Reserved.