Search in sources :

Example 1 with CoreAttributes

use of ddf.catalog.data.impl.types.CoreAttributes 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 2 with CoreAttributes

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

the class SaxEventHandlerUtilsTest method setup.

@BeforeClass
public static void setup() {
    CoreAttributes coreAttributes = new CoreAttributes();
    descriptors.add(coreAttributes.getAttributeDescriptor(CoreAttributes.ID));
    descriptors.add(coreAttributes.getAttributeDescriptor(CoreAttributes.LANGUAGE));
}
Also used : CoreAttributes(ddf.catalog.data.impl.types.CoreAttributes) BeforeClass(org.junit.BeforeClass)

Example 3 with CoreAttributes

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

the class TestTransactionRequestConverter 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.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)

Example 4 with CoreAttributes

use of ddf.catalog.data.impl.types.CoreAttributes 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)

Aggregations

CoreAttributes (ddf.catalog.data.impl.types.CoreAttributes)4 ContactAttributes (ddf.catalog.data.impl.types.ContactAttributes)3 MediaAttributes (ddf.catalog.data.impl.types.MediaAttributes)3 TopicAttributes (ddf.catalog.data.impl.types.TopicAttributes)3 Before (org.junit.Before)3 AssociationsAttributes (ddf.catalog.data.impl.types.AssociationsAttributes)2 LocationAttributes (ddf.catalog.data.impl.types.LocationAttributes)2 XStream (com.thoughtworks.xstream.XStream)1 Converter (com.thoughtworks.xstream.converters.Converter)1 Xpp3Driver (com.thoughtworks.xstream.io.xml.Xpp3Driver)1 MetacardTypeImpl (ddf.catalog.data.impl.MetacardTypeImpl)1 DateTimeAttributes (ddf.catalog.data.impl.types.DateTimeAttributes)1 XmlParser (org.codice.ddf.parser.xml.XmlParser)1 RegistryObjectMetacardType (org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType)1 CswRecordConverter (org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter)1 BeforeClass (org.junit.BeforeClass)1