Search in sources :

Example 1 with WfsMetacardTypeRegistry

use of org.codice.ddf.spatial.ogc.wfs.catalog.metacardtype.registry.WfsMetacardTypeRegistry in project ddf by codice.

the class XStreamWfs11FeatureTransformerTest method mockMetacardTypeRegistry.

private WfsMetacardTypeRegistry mockMetacardTypeRegistry() throws IOException {
    WfsMetacardTypeRegistry metacardTypeRegistry = mock(WfsMetacardTypeRegistry.class);
    XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
    InputStream inputStream = getClass().getResourceAsStream("/Neverland_FeatureType.xsd");
    XmlSchema schema = schemaCollection.read(new StreamSource(inputStream));
    inputStream.close();
    FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, PETER_PAN_NAME, Collections.emptySet(), Wfs11Constants.GML_3_1_1_NAMESPACE, FeatureMetacardType.DEFAULT_METACARD_TYPE_ENHANCER);
    when(metacardTypeRegistry.lookupMetacardTypeBySimpleName(SOURCE_ID, PETER_PAN_NAME.getLocalPart())).thenReturn(Optional.of(featureMetacardType));
    return metacardTypeRegistry;
}
Also used : WfsMetacardTypeRegistry(org.codice.ddf.spatial.ogc.wfs.catalog.metacardtype.registry.WfsMetacardTypeRegistry) XmlSchema(org.apache.ws.commons.schema.XmlSchema) BufferedInputStream(java.io.BufferedInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) StreamSource(javax.xml.transform.stream.StreamSource) XmlSchemaCollection(org.apache.ws.commons.schema.XmlSchemaCollection) FeatureMetacardType(org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType)

Aggregations

BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 StreamSource (javax.xml.transform.stream.StreamSource)1 XmlSchema (org.apache.ws.commons.schema.XmlSchema)1 XmlSchemaCollection (org.apache.ws.commons.schema.XmlSchemaCollection)1 FeatureMetacardType (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType)1 WfsMetacardTypeRegistry (org.codice.ddf.spatial.ogc.wfs.catalog.metacardtype.registry.WfsMetacardTypeRegistry)1