use of org.codice.ddf.parser.xml.XmlParser in project ddf by codice.
the class IdentityNodeInitializationTest method setUp.
@Before
public void setUp() throws Exception {
parser = spy(new XmlParser());
identityNodeInitialization = spy(new IdentityNodeInitialization());
registryTransformer = spy(new RegistryTransformer());
metacardMarshaller = spy(new MetacardMarshaller(parser));
registryTransformer.setParser(parser);
registryTransformer.setRegistryMetacardType(new RegistryObjectMetacardType());
identityNodeInitialization.setRegistryTransformer(registryTransformer);
identityNodeInitialization.setMetacardMarshaller(metacardMarshaller);
identityNodeInitialization.setFederationAdminService(federationAdminService);
identityNodeInitialization.setExecutorService(executorService);
System.setProperty(SystemInfo.SITE_NAME, TEST_SITE_NAME);
System.setProperty(SystemInfo.VERSION, TEST_VERSION);
testMetacard = getTestMetacard();
testMetacard.setAttribute(new AttributeImpl(Metacard.METADATA, ""));
}
use of org.codice.ddf.parser.xml.XmlParser in project ddf by codice.
the class IdentificationPluginTest method setUp.
@Before
public void setUp() {
UuidGenerator uuidGenerator = mock(UuidGenerator.class);
when(uuidGenerator.generateUuid()).thenReturn(UUID.randomUUID().toString());
parser = new XmlParser();
identificationPlugin = new IdentificationPlugin(uuidGenerator);
identificationPlugin.setMetacardMarshaller(new MetacardMarshaller(parser));
identificationPlugin.setRegistryIdPostIngestPlugin(new RegistryIdPostIngestPlugin());
setParser(parser);
sampleData = new MetacardImpl();
sampleData.setId("testNewMetacardId");
sampleData.setAttribute(RegistryObjectMetacardType.REGISTRY_ID, "testNewRegistryId");
sampleData.setAttribute(Metacard.MODIFIED, new Date().from(Instant.now()));
Set<String> tags = new HashSet<>();
tags.add("registry");
sampleData.setTags(tags);
System.setProperty(RegistryConstants.REGISTRY_ID_PROPERTY, "systemRegistryId");
}
use of org.codice.ddf.parser.xml.XmlParser 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");
}
use of org.codice.ddf.parser.xml.XmlParser in project ddf by codice.
the class SlotTypeHelperTest method setUpOnce.
@BeforeClass
public static void setUpOnce() throws Exception {
parser = new XmlParser();
configurator = parser.configureParser(Arrays.asList(RegistryObjectType.class.getPackage().getName(), EbrimConstants.OGC_FACTORY.getClass().getPackage().getName(), EbrimConstants.GML_FACTORY.getClass().getPackage().getName()), SlotTypeHelper.class.getClassLoader());
registryObject = getRegistryObjectFromResource("/registry-package-slots-only.xml");
}
use of org.codice.ddf.parser.xml.XmlParser in project ddf by codice.
the class RegistryPackageTypeHelperTest method setUpOnce.
@BeforeClass
public static void setUpOnce() throws Exception {
parser = new XmlParser();
configurator = parser.configureParser(Arrays.asList(RegistryObjectType.class.getPackage().getName(), EbrimConstants.OGC_FACTORY.getClass().getPackage().getName(), EbrimConstants.GML_FACTORY.getClass().getPackage().getName()), RegistryPackageTypeHelperTest.class.getClassLoader());
registryObject = getRegistryObjectFromResource("/csw-full-registry-package.xml");
rptHelper = new RegistryPackageTypeHelper((RegistryPackageType) registryObject);
}
Aggregations