Search in sources :

Example 1 with ResourceIdType

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

the class TestWfsFilterDelegate method testFeatureTypeFeatureID.

@Test
public void testFeatureTypeFeatureID() throws Exception {
    String mockProperty = "myPropertyName";
    String mockType = "myType";
    WfsFilterDelegate delegate = mockFeatureMetacardCreateDelegate(mockProperty, mockType);
    String featureId = "1234567";
    String mockTypeFeatureId = mockType + "." + featureId;
    //Perform Test
    FilterType matchIdFilter = delegate.propertyIsEqualTo(Metacard.ID, mockTypeFeatureId, true);
    //Verify
    assertThat(((ResourceIdType) matchIdFilter.getId().get(0).getValue()).getRid(), is(mockTypeFeatureId));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) Test(org.junit.Test)

Example 2 with ResourceIdType

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

the class WfsFilterDelegate method createFeatureIdFilter.

private JAXBElement<ResourceIdType> createFeatureIdFilter(final String id) {
    ResourceIdType resId = new ResourceIdType();
    resId.setRid(id);
    ObjectFactory objFact = new ObjectFactory();
    return objFact.createResourceId(resId);
}
Also used : ResourceIdType(net.opengis.filter.v_2_0_0.ResourceIdType) ObjectFactory(net.opengis.filter.v_2_0_0.ObjectFactory)

Example 3 with ResourceIdType

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

the class WfsFilterDelegate method buildFeatureIdFilter.

private FilterType buildFeatureIdFilter(Set<String> ids) {
    FilterType filterType = new FilterType();
    for (String id : ids) {
        List<JAXBElement<? extends AbstractIdType>> idFilterTypeList = filterType.getId();
        ResourceIdType resId = new ResourceIdType();
        resId.setRid(id);
        idFilterTypeList.add(filterObjectFactory.createResourceId(resId));
    }
    return filterType;
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) ResourceIdType(net.opengis.filter.v_2_0_0.ResourceIdType) LineString(org.locationtech.jts.geom.LineString) JAXBElement(javax.xml.bind.JAXBElement) AbstractIdType(net.opengis.filter.v_2_0_0.AbstractIdType)

Example 4 with ResourceIdType

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

the class WfsFilterDelegateTest method testFeatureTypeFeatureID.

@Test
public void testFeatureTypeFeatureID() {
    String mockProperty = "myPropertyName";
    String mockType = "myType";
    WfsFilterDelegate delegate = mockFeatureMetacardCreateDelegate(mockProperty, mockType);
    String featureId = "1234567";
    String mockTypeFeatureId = mockType + "." + featureId;
    // Perform Test
    FilterType matchIdFilter = delegate.propertyIsEqualTo(Metacard.ID, mockTypeFeatureId, true);
    // Verify
    assertThat(((ResourceIdType) matchIdFilter.getId().get(0).getValue()).getRid(), is(mockTypeFeatureId));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) Test(org.junit.Test)

Example 5 with ResourceIdType

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

the class WfsFilterDelegateTest method testFeatureID.

@Test
public void testFeatureID() {
    String mockProperty = "myPropertyName";
    String mockType = "myType";
    WfsFilterDelegate delegate = mockFeatureMetacardCreateDelegate(mockProperty, mockType);
    String featureId = "1234567";
    // Perform Test
    FilterType matchIdFilter = delegate.propertyIsLike(Metacard.ID, featureId, true);
    // Verify
    assertThat(((ResourceIdType) matchIdFilter.getId().get(0).getValue()).getRid(), is(featureId));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) Test(org.junit.Test)

Aggregations

FilterType (net.opengis.filter.v_2_0_0.FilterType)6 Test (org.junit.Test)4 ResourceIdType (net.opengis.filter.v_2_0_0.ResourceIdType)3 JAXBElement (javax.xml.bind.JAXBElement)2 AbstractIdType (net.opengis.filter.v_2_0_0.AbstractIdType)2 LineString (org.locationtech.jts.geom.LineString)2 HashSet (java.util.HashSet)1 ObjectFactory (net.opengis.filter.v_2_0_0.ObjectFactory)1