Search in sources :

Example 6 with DescribeFeatureTypeRequest

use of org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.DescribeFeatureTypeRequest in project ddf by codice.

the class WfsSourceTest method testConfigureFeatureTypesDescribeFeatureException.

@Test
public void testConfigureFeatureTypesDescribeFeatureException() throws WfsException {
    ArgumentCaptor<DescribeFeatureTypeRequest> captor = ArgumentCaptor.forClass(DescribeFeatureTypeRequest.class);
    WfsSource source = getWfsSource(ONE_TEXT_PROPERTY_SCHEMA, MockWfsServer.getFilterCapabilities(), 1, true);
    final String SAMPLE_FEATURE_NAME0 = SAMPLE_FEATURE_NAME + "0";
    verify(mockWfs).describeFeatureType(captor.capture());
    DescribeFeatureTypeRequest describeFeatureType = captor.getValue();
    // sample feature 0 does not have a prefix
    assertThat(SAMPLE_FEATURE_NAME0, equalTo(describeFeatureType.getTypeName()));
    assertTrue(source.featureTypeFilters.isEmpty());
    assertTrue(source.getContentTypes().isEmpty());
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) DescribeFeatureTypeRequest(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.DescribeFeatureTypeRequest) Test(org.junit.Test)

Example 7 with DescribeFeatureTypeRequest

use of org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.DescribeFeatureTypeRequest in project ddf by codice.

the class WfsSourceTest method testConfigureFeatureTypes.

@Test
public void testConfigureFeatureTypes() throws WfsException {
    ArgumentCaptor<DescribeFeatureTypeRequest> captor = ArgumentCaptor.forClass(DescribeFeatureTypeRequest.class);
    WfsSource source = getWfsSource(ONE_TEXT_PROPERTY_SCHEMA, MockWfsServer.getFilterCapabilities(), 1);
    final String SAMPLE_FEATURE_NAME0 = SAMPLE_FEATURE_NAME + "0";
    verify(mockWfs).describeFeatureType(captor.capture());
    DescribeFeatureTypeRequest describeFeatureType = captor.getValue();
    // sample feature 0 does not have a prefix
    assertThat(SAMPLE_FEATURE_NAME0, equalTo(describeFeatureType.getTypeName()));
    assertTrue(source.isAvailable());
    assertThat(source.featureTypeFilters.size(), is(1));
    WfsFilterDelegate delegate = source.featureTypeFilters.get(new QName(SAMPLE_FEATURE_NAME0));
    assertThat(delegate, notNullValue());
    assertThat(source.getContentTypes().size(), is(1));
    List<ContentType> types = new ArrayList<>();
    types.addAll(source.getContentTypes());
    assertTrue(SAMPLE_FEATURE_NAME0.equals(types.get(0).getName()));
}
Also used : ContentType(ddf.catalog.data.ContentType) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) Matchers.containsString(org.hamcrest.Matchers.containsString) DescribeFeatureTypeRequest(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.DescribeFeatureTypeRequest) Test(org.junit.Test)

Aggregations

DescribeFeatureTypeRequest (org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.DescribeFeatureTypeRequest)5 QName (javax.xml.namespace.QName)4 Matchers.containsString (org.hamcrest.Matchers.containsString)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 WebApplicationException (javax.ws.rs.WebApplicationException)3 XmlSchema (org.apache.ws.commons.schema.XmlSchema)3 FeatureMetacardType (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType)3 WfsException (org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException)3 ContentType (ddf.catalog.data.ContentType)2 MetacardMapper (org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper)2 MetacardType (ddf.catalog.data.MetacardType)1 Hashtable (java.util.Hashtable)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 FeatureTypeType (net.opengis.wfs.v_1_1_0.FeatureTypeType)1 FeatureTypeType (net.opengis.wfs.v_2_0_0.FeatureTypeType)1 FeatureTypeType (ogc.schema.opengis.wfs_capabilities.v_1_0_0.FeatureTypeType)1 WfsMetadataImpl (org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsMetadataImpl)1