Search in sources :

Example 1 with CswRecordMap

use of org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswRecordMap in project ddf by codice.

the class CswQueryFactoryTest method setUp.

@org.junit.Before
public void setUp() throws URISyntaxException, SourceUnavailableException, UnsupportedQueryException, FederationException, ParseException, IngestException {
    FilterBuilder filterBuilder = new GeotoolsFilterBuilder();
    FilterAdapter filterAdapter = new GeotoolsFilterAdapterImpl();
    CswRecordMap cswRecordMap = new MetacardCswRecordMap();
    queryFactory = new CswQueryFactory(cswRecordMap, filterBuilder, filterAdapter, new PermissionsImpl());
    AttributeRegistryImpl attributeRegistry = new AttributeRegistryImpl();
    attributeRegistry.registerMetacardType(getCswMetacardType());
    queryFactory.setAttributeRegistry(attributeRegistry);
    polygon = new WKTReader().read(POLYGON_STR);
    gmlObjectFactory = new net.opengis.gml.v_3_1_1.ObjectFactory();
    filterObjectFactory = new ObjectFactory();
    queryFilterTransformerProvider = mock(QueryFilterTransformerProvider.class);
    QueryFilterTransformer cswQueryFilter = new CswQueryFilterTransformer(new MetacardCswRecordMap(), attributeRegistry);
    when(queryFilterTransformerProvider.getTransformer(new QName(CswConstants.CSW_OUTPUT_SCHEMA, "Record"))).thenReturn(Optional.of(cswQueryFilter));
    when(queryFilterTransformerProvider.getTransformer(anyString())).thenReturn(Optional.of(cswQueryFilter));
    queryFactory.setQueryFilterTransformerProvider(queryFilterTransformerProvider);
}
Also used : AttributeRegistryImpl(ddf.catalog.data.impl.AttributeRegistryImpl) QueryFilterTransformerProvider(ddf.catalog.transform.QueryFilterTransformerProvider) QName(javax.xml.namespace.QName) FilterAdapter(ddf.catalog.filter.FilterAdapter) CswQueryFilterTransformer(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswQueryFilterTransformer) CswRecordMap(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswRecordMap) MetacardCswRecordMap(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.mappings.MetacardCswRecordMap) WKTReader(org.locationtech.jts.io.WKTReader) ObjectFactory(net.opengis.filter.v_1_1_0.ObjectFactory) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) FilterBuilder(ddf.catalog.filter.FilterBuilder) PermissionsImpl(ddf.security.permission.impl.PermissionsImpl) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) GeotoolsFilterAdapterImpl(ddf.catalog.filter.proxy.adapter.GeotoolsFilterAdapterImpl) MetacardCswRecordMap(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.mappings.MetacardCswRecordMap) QueryFilterTransformer(ddf.catalog.transform.QueryFilterTransformer) CswQueryFilterTransformer(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswQueryFilterTransformer)

Aggregations

AttributeRegistryImpl (ddf.catalog.data.impl.AttributeRegistryImpl)1 FilterAdapter (ddf.catalog.filter.FilterAdapter)1 FilterBuilder (ddf.catalog.filter.FilterBuilder)1 GeotoolsFilterAdapterImpl (ddf.catalog.filter.proxy.adapter.GeotoolsFilterAdapterImpl)1 GeotoolsFilterBuilder (ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder)1 QueryFilterTransformer (ddf.catalog.transform.QueryFilterTransformer)1 QueryFilterTransformerProvider (ddf.catalog.transform.QueryFilterTransformerProvider)1 PermissionsImpl (ddf.security.permission.impl.PermissionsImpl)1 QName (javax.xml.namespace.QName)1 ObjectFactory (net.opengis.filter.v_1_1_0.ObjectFactory)1 MetacardCswRecordMap (org.codice.ddf.spatial.ogc.csw.catalog.endpoint.mappings.MetacardCswRecordMap)1 CswQueryFilterTransformer (org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswQueryFilterTransformer)1 CswRecordMap (org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswRecordMap)1 WKTReader (org.locationtech.jts.io.WKTReader)1