Search in sources :

Example 1 with LogicOpsType

use of ogc.schema.opengis.filter.v_1_0_0.LogicOpsType in project ddf by codice.

the class TestWfsSource method testTwoIntersectQuery.

@Test
public void testTwoIntersectQuery() throws UnsupportedQueryException, WfsException, SecurityServiceException {
    setUp(TWO_GML_PROPERTY_SCHEMA, Arrays.asList(new Intersect(), new BBOX()), SRS_NAME, ONE_FEATURE, null);
    Filter intersectFilter = builder.attribute(Metacard.ANY_GEO).is().intersecting().wkt(POLYGON_WKT);
    QueryImpl intersectQuery = new QueryImpl(intersectFilter);
    intersectQuery.setPageSize(MAX_FEATURES);
    ArgumentCaptor<GetFeatureType> captor = ArgumentCaptor.forClass(GetFeatureType.class);
    source.query(new QueryRequestImpl(intersectQuery));
    verify(mockWfs).getFeature(captor.capture());
    GetFeatureType getFeatureType = captor.getValue();
    assertMaxFeatures(getFeatureType, intersectQuery);
    assertTrue(getFeatureType.getQuery().size() == ONE_FEATURE);
    QueryType query = getFeatureType.getQuery().get(0);
    assertTrue(query.getTypeName().equals(sampleFeatures.get(0)));
    // The Text Properties should be ORed
    assertNotNull(query.getFilter());
    assertTrue(query.getFilter().isSetLogicOps());
    assertTrue(query.getFilter().getLogicOps().getValue() instanceof LogicOpsType);
}
Also used : Intersect(ogc.schema.opengis.filter_capabilities.v_1_0_0.Intersect) QueryImpl(ddf.catalog.operation.impl.QueryImpl) Filter(org.opengis.filter.Filter) BBOX(ogc.schema.opengis.filter_capabilities.v_1_0_0.BBOX) QueryRequestImpl(ddf.catalog.operation.impl.QueryRequestImpl) QueryType(ogc.schema.opengis.wfs.v_1_0_0.QueryType) LogicOpsType(ogc.schema.opengis.filter.v_1_0_0.LogicOpsType) GetFeatureType(ogc.schema.opengis.wfs.v_1_0_0.GetFeatureType) Test(org.junit.Test)

Aggregations

QueryImpl (ddf.catalog.operation.impl.QueryImpl)1 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)1 LogicOpsType (ogc.schema.opengis.filter.v_1_0_0.LogicOpsType)1 BBOX (ogc.schema.opengis.filter_capabilities.v_1_0_0.BBOX)1 Intersect (ogc.schema.opengis.filter_capabilities.v_1_0_0.Intersect)1 GetFeatureType (ogc.schema.opengis.wfs.v_1_0_0.GetFeatureType)1 QueryType (ogc.schema.opengis.wfs.v_1_0_0.QueryType)1 Test (org.junit.Test)1 Filter (org.opengis.filter.Filter)1