Search in sources :

Example 91 with FilterType

use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.

the class TestCswFilterDelegate method testPropertyIsGreaterThanOrEqualToShortLiteral.

@Test
public void testPropertyIsGreaterThanOrEqualToShortLiteral() throws JAXBException, SAXException, IOException {
    FilterType filterType = cswFilterDelegateLatLon.propertyIsGreaterThanOrEqualTo(propertyName, shortLiteral);
    assertXMLEqual(propertyIsGreaterThanOrEqualToXml, getXmlFromMarshaller(filterType));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Example 92 with FilterType

use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.

the class TestCswFilterDelegate method testPropertyBetweenStringLiterals.

/**
     * Property is between tests
     */
@Test
public void testPropertyBetweenStringLiterals() throws JAXBException, SAXException, IOException {
    FilterType filterType = cswFilterDelegateLatLon.propertyIsBetween(propertyName, stringLowerBoundary, stringUpperBoundary);
    assertXMLEqual(propertyIsBetweenXml, getXmlFromMarshaller(filterType));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Example 93 with FilterType

use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.

the class TestCswFilterDelegate method testFeatureIdOr.

@Test
public void testFeatureIdOr() throws JAXBException, SAXException, IOException, XpathException {
    ObjectFactory filterObjectFactory = new ObjectFactory();
    FeatureIdType fidType = new FeatureIdType();
    fidType.setFid("cswRecord.1234");
    List<JAXBElement<? extends AbstractIdType>> fidFilters = new ArrayList<>();
    fidFilters.add(filterObjectFactory.createFeatureId(fidType));
    FilterType idFilter = new FilterType();
    idFilter.setId(fidFilters);
    FeatureIdType fidType2 = new FeatureIdType();
    fidType2.setFid("cswRecord.5678");
    List<JAXBElement<? extends AbstractIdType>> fidFilters2 = new ArrayList<>();
    fidFilters2.add(filterObjectFactory.createFeatureId(fidType2));
    FilterType idFilter2 = new FilterType();
    idFilter2.setId(fidFilters2);
    List<FilterType> filters = new ArrayList<>();
    filters.add(idFilter);
    filters.add(idFilter2);
    FilterType filterType = cswFilterDelegateLatLon.or(filters);
    String xml = getXmlFromMarshaller(filterType);
    assertXpathExists("/ogc:Filter/ogc:FeatureId[@fid='cswRecord.1234']", xml);
    assertXpathExists("/ogc:Filter/ogc:FeatureId[@fid='cswRecord.5678']", xml);
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) ObjectFactory(net.opengis.filter.v_1_1_0.ObjectFactory) ArrayList(java.util.ArrayList) JAXBElement(javax.xml.bind.JAXBElement) AbstractIdType(net.opengis.filter.v_1_1_0.AbstractIdType) FeatureIdType(net.opengis.filter.v_1_1_0.FeatureIdType) Test(org.junit.Test)

Example 94 with FilterType

use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.

the class TestCswFilterDelegate method testIntersectsPropertyOwsBoundingBoxMultiPoint.

@Test
public void testIntersectsPropertyOwsBoundingBoxMultiPoint() throws JAXBException, SAXException, IOException {
    String propName = CswConstants.BBOX_PROP;
    FilterType filterType = cswFilterDelegateLatLon.intersects(propName, multiPointWkt);
    assertXMLEqual(intersectsMultiPointXmlPropertyOwsBoundingBox, getXmlFromMarshaller(filterType));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Example 95 with FilterType

use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.

the class TestCswFilterDelegate method testBefore.

@Test
public void testBefore() throws Exception {
    // Setup
    CswSourceConfiguration cswSourceConfiguration = initCswSourceConfiguration(CswAxisOrder.LAT_LON, false, CswConstants.CSW_TYPE, effectiveDateMapping, createdDateMapping, modifiedDateMapping, CswConstants.CSW_IDENTIFIER);
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    String dateStr = fmt.print(testStartDate);
    String controlFilterAsXml = beforeXml.replace(REPLACE_TEMPORAL_PROPERTY, createdDateMapping).replace(REPLACE_DATE, dateStr);
    CswFilterDelegate localCswFilterDelegate = createCswFilterDelegate(cswSourceConfiguration);
    // Perform Test
    FilterType filterType = localCswFilterDelegate.before(propertyNameCreated, testStartDate.toDate());
    // Verify
    assertXMLEqual(controlFilterAsXml, getXmlFromMarshaller(filterType));
}
Also used : CswSourceConfiguration(org.codice.ddf.spatial.ogc.csw.catalog.common.CswSourceConfiguration) FilterType(net.opengis.filter.v_1_1_0.FilterType) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)212 FilterType (net.opengis.filter.v_1_1_0.FilterType)209 FilterType (net.opengis.filter.v_2_0_0.FilterType)58 ArrayList (java.util.ArrayList)50 JAXBElement (javax.xml.bind.JAXBElement)12 CswSourceConfiguration (org.codice.ddf.spatial.ogc.csw.catalog.common.CswSourceConfiguration)12 BinaryTemporalOpType (net.opengis.filter.v_2_0_0.BinaryTemporalOpType)11 FeatureAttributeDescriptor (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureAttributeDescriptor)11 QName (javax.xml.namespace.QName)10 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)10 LineString (com.vividsolutions.jts.geom.LineString)9 Date (java.util.Date)9 DistanceBufferType (net.opengis.filter.v_2_0_0.DistanceBufferType)9 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)9 DateTime (org.joda.time.DateTime)8 Method (java.lang.reflect.Method)7 QueryConstraintType (net.opengis.cat.csw.v_2_0_2.QueryConstraintType)7 FilterCapabilities (net.opengis.filter.v_2_0_0.FilterCapabilities)7 TimePeriodType (net.opengis.gml.v_3_2_1.TimePeriodType)7 TimePositionType (net.opengis.gml.v_3_2_1.TimePositionType)7