use of org.mycore.datamodel.metadata.MCRObjectID in project mycore by MyCoRe-Org.
the class MCRMapObjectIDDOIGeneratorTest method missingMappingTest.
@Test(expected = MCRPersistentIdentifierException.class)
public void missingMappingTest() throws Exception {
MCRObjectID brandNewTest00000001 = MCRObjectID.getInstance("brandNew_test_00000001");
doiGenerator.generate(brandNewTest00000001, null);
}
use of org.mycore.datamodel.metadata.MCRObjectID in project mycore by MyCoRe-Org.
the class MCRMapObjectIDDOIGeneratorTest method generate.
@Test
public void generate() throws Exception {
MCRObjectID junitTest00004711 = MCRObjectID.getInstance("junit_test_00004711");
MCRObjectID myTest00000815 = MCRObjectID.getInstance("my_test_00000815");
assertEquals(TEST_DOI_PREFIX + "/4711", doiGenerator.generate(junitTest00004711, null).asString());
assertEquals(TEST_DOI_PREFIX + "/my.815", doiGenerator.generate(myTest00000815, null).asString());
}
use of org.mycore.datamodel.metadata.MCRObjectID in project mycore by MyCoRe-Org.
the class MCRIDPURLGeneratorTest method generate.
@Test
public void generate() throws MCRPersistentIdentifierException {
MCRObjectID testID = MCRObjectID.getInstance("my_test_00000001");
MCRIDPURLGenerator generator1 = new MCRIDPURLGenerator(GENERATOR_1);
Assert.assertEquals("", generator1.generate(testID, "").asString(), "http://purl.myurl.de/my_test_00000001");
MCRIDPURLGenerator generator2 = new MCRIDPURLGenerator(GENERATOR_2);
Assert.assertEquals("", generator2.generate(testID, "").asString(), "http://purl.myurl.de/my_test_00000001/my_test_00000001/my_test_00000001");
}
use of org.mycore.datamodel.metadata.MCRObjectID in project mycore by MyCoRe-Org.
the class MCRDNBURNGeneratorTest method generate.
@Test
public void generate() throws Exception {
MCRObjectID getID = MCRObjectID.getNextFreeId("test", "mock");
MCRDNBURN generated = new MCRFLURNGenerator(GENERATOR_ID).generate(getID, "");
String urn = generated.asString();
LOGGER.info("THE URN IS: {}", urn);
Assert.assertFalse(urn.startsWith("urn:nbn:de:urn:nbn:de"));
}
use of org.mycore.datamodel.metadata.MCRObjectID in project mycore by MyCoRe-Org.
the class MCRSolrTransformerInputDocumentFactory method getMergedDocument.
private Document getMergedDocument(Map<MCRObjectID, MCRContent> contentMap) throws IOException, SAXException, JDOMException {
Element rootElement = new Element("add");
Document doc = new Document(rootElement);
for (Map.Entry<MCRObjectID, MCRContent> entry : contentMap.entrySet()) {
rootElement.addContent(entry.getValue().asXML().detachRootElement());
}
return doc;
}
Aggregations