Search in sources :

Example 6 with MediaAttributes

use of ddf.catalog.data.impl.types.MediaAttributes in project ddf by codice.

the class TestTransactionMessageBodyReader method setup.

@Before
public void setup() {
    cswRecordConverter = new CswRecordConverter(CswQueryFactoryTest.getCswMetacardType());
    new CoreAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
    new ContactAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
    new LocationAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
    new MediaAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
    new TopicAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
    new AssociationsAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
}
Also used : ContactAttributes(ddf.catalog.data.impl.types.ContactAttributes) LocationAttributes(ddf.catalog.data.impl.types.LocationAttributes) CoreAttributes(ddf.catalog.data.impl.types.CoreAttributes) AssociationsAttributes(ddf.catalog.data.impl.types.AssociationsAttributes) MediaAttributes(ddf.catalog.data.impl.types.MediaAttributes) CswRecordConverter(org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter) TopicAttributes(ddf.catalog.data.impl.types.TopicAttributes) Before(org.junit.Before)

Example 7 with MediaAttributes

use of ddf.catalog.data.impl.types.MediaAttributes in project ddf by codice.

the class RegistryTransformerTest method setUp.

@Before
public void setUp() {
    registryTransformer = new RegistryTransformer();
    parser = new XmlParser();
    metacardTypes = new ArrayList<>();
    metacardTypes.addAll(Arrays.asList(new RegistryObjectMetacardType(), new TopicAttributes(), new MediaAttributes(), new ContactAttributes(), new CoreAttributes(), new DateTimeAttributes()));
    metacardType = new MetacardTypeImpl("registryMetacard", metacardTypes);
    registryTransformer.setParser(parser);
    registryTransformer.setRegistryMetacardType(metacardType);
    System.setProperty(RegistryConstants.REGISTRY_ID_PROPERTY, "identityRegistryId");
}
Also used : XmlParser(org.codice.ddf.parser.xml.XmlParser) ContactAttributes(ddf.catalog.data.impl.types.ContactAttributes) DateTimeAttributes(ddf.catalog.data.impl.types.DateTimeAttributes) CoreAttributes(ddf.catalog.data.impl.types.CoreAttributes) MediaAttributes(ddf.catalog.data.impl.types.MediaAttributes) MetacardTypeImpl(ddf.catalog.data.impl.MetacardTypeImpl) RegistryObjectMetacardType(org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType) TopicAttributes(ddf.catalog.data.impl.types.TopicAttributes) Before(org.junit.Before)

Example 8 with MediaAttributes

use of ddf.catalog.data.impl.types.MediaAttributes in project ddf by codice.

the class TransactionRequestConverterTest method setup.

@Before
public void setup() {
    cswRecordConverter = mock(Converter.class);
    when(cswRecordConverter.canConvert(any())).thenReturn(true);
    new CoreAttributes().getAttributeDescriptors().stream().forEach(d -> mockRegistry.register(d));
    new ContactAttributes().getAttributeDescriptors().stream().forEach(d -> mockRegistry.register(d));
    new LocationAttributes().getAttributeDescriptors().stream().forEach(d -> mockRegistry.register(d));
    new MediaAttributes().getAttributeDescriptors().stream().forEach(d -> mockRegistry.register(d));
    new TopicAttributes().getAttributeDescriptors().stream().forEach(d -> mockRegistry.register(d));
    new AssociationsAttributes().getAttributeDescriptors().stream().forEach(d -> mockRegistry.register(d));
    xStream = new XStream(new Xpp3Driver());
    xStream.allowTypesByWildcard(new String[] { "ddf.**", "org.codice.**" });
    xStream.registerConverter(new TransactionRequestConverter(cswRecordConverter, mockRegistry));
    xStream.alias(CswConstants.CSW_TRANSACTION, CswTransactionRequest.class);
}
Also used : Xpp3Driver(com.thoughtworks.xstream.io.xml.Xpp3Driver) ContactAttributes(ddf.catalog.data.impl.types.ContactAttributes) LocationAttributes(ddf.catalog.data.impl.types.LocationAttributes) XStream(com.thoughtworks.xstream.XStream) CoreAttributes(ddf.catalog.data.impl.types.CoreAttributes) AssociationsAttributes(ddf.catalog.data.impl.types.AssociationsAttributes) Converter(com.thoughtworks.xstream.converters.Converter) MediaAttributes(ddf.catalog.data.impl.types.MediaAttributes) TopicAttributes(ddf.catalog.data.impl.types.TopicAttributes) Before(org.junit.Before)

Aggregations

MediaAttributes (ddf.catalog.data.impl.types.MediaAttributes)8 ContactAttributes (ddf.catalog.data.impl.types.ContactAttributes)7 TopicAttributes (ddf.catalog.data.impl.types.TopicAttributes)7 AssociationsAttributes (ddf.catalog.data.impl.types.AssociationsAttributes)6 LocationAttributes (ddf.catalog.data.impl.types.LocationAttributes)6 CoreAttributes (ddf.catalog.data.impl.types.CoreAttributes)5 Before (org.junit.Before)5 MetacardTypeImpl (ddf.catalog.data.impl.MetacardTypeImpl)4 CswRecordConverter (org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter)4 Metacard (ddf.catalog.data.Metacard)3 Test (org.junit.Test)3 XStream (com.thoughtworks.xstream.XStream)2 Converter (com.thoughtworks.xstream.converters.Converter)2 Xpp3Driver (com.thoughtworks.xstream.io.xml.Xpp3Driver)2 MetacardType (ddf.catalog.data.MetacardType)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStream (java.io.InputStream)2 MultivaluedHashMap (javax.ws.rs.core.MultivaluedHashMap)2 CswRecordCollection (org.codice.ddf.spatial.ogc.csw.catalog.common.CswRecordCollection)2 CswSourceConfiguration (org.codice.ddf.spatial.ogc.csw.catalog.common.CswSourceConfiguration)2