Commit 82893b3e authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Update tests for OAI identifiers, which have changed at Uni Hamburg

parent 88be6135
......@@ -113,7 +113,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
new XsltTransformerOaiPmhBundlesStreamSource(
"https://journals.sub.uni-hamburg.de/giga/afsp/oai/", map, LocalDate.parse("2017-01-01"), LocalDate.parse("2017-07-01") );
//Stream<Bundle> bundles = bss.getBundlesStream();
Bundle bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/33");
Bundle bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/33");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "2") ) );
......@@ -125,7 +125,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.ddc", "324") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "DEU") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/122");
bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/122");
metadata = bundle.getMetadata();
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "The Ethiopian Second Republic and the Fragile “Social Contract”") ) );
......@@ -133,11 +133,12 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.issuetopic") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "3-28") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/1054");
bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/1054");
metadata = bundle.getMetadata();
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Review: Anika Becher, Explaining Ethnic and Election Violence: Kenya and Malawi in Comparison (2016)") ) );
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.issuetopic") ) );
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.pageinfo") ) );
//assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.pageinfo") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "132-133") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "political unrest; violence; elections/voting; ethnic conflicts; comparative analysis") ) ); // test for replacing commas with semicolons
}
......@@ -163,7 +164,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
new XsltTransformerOaiPmhBundlesStreamSource(
"https://journals.sub.uni-hamburg.de/giga/jcca/oai/", map, LocalDate.parse("2017-01-01"), LocalDate.parse("2017-07-01") );
*/
Bundle bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/968");
Bundle bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/968");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
......@@ -192,7 +193,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "DEU") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/1046");
bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/1046");
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "Getting the Numbers Right on China’s Actual Overseas Investment: The Case of the Netherlands") ) );
......@@ -201,7 +202,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Greeven, Mark J.") ) ); // yes, double space :(
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Ebbers, Haico") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/996");
bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/996");
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.date.issued", "2016") ) );
......@@ -231,7 +232,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
new XsltTransformerOaiPmhBundlesStreamSource(
"https://journals.sub.uni-hamburg.de/giga/jcca/oai/", map, LocalDate.parse("2017-01-01"), LocalDate.parse("2017-07-01") );
*/
Bundle bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/1057");
Bundle bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/1057");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
......@@ -266,7 +267,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.stream().noneMatch( m -> m.getKey().equals("dc.source.issuetopic") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "DEU") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/277");
bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/277");
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "No Country for Leftists? Clientelist Continuity and the 2006 Vote in the Brazilian Northeast") ) );
......@@ -274,7 +275,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "Subnational Authoritarianism and Democratization in Latin America") ) ); // yes, double space :(
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "113-153") ) );
bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/1002");
bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/1002");
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.date.issued", "2016") ) );
......@@ -304,7 +305,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
new XsltTransformerOaiPmhBundlesStreamSource(
"https://journals.sub.uni-hamburg.de/giga/jcca/oai/", map, LocalDate.parse("2017-01-01"), LocalDate.parse("2017-07-01") );
*/
Bundle bundle = bss.getBundle("oai:hup.sub.uni-hamburg.de.giga:article/952");
Bundle bundle = bss.getBundle("oai:journals.sub.uni-hamburg.de.giga:article/952");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
......@@ -584,8 +585,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.17645/up.v1i3.686") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "PRT") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.classoz", "20700") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.ddc", "710") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.classoz", "20700") ) );
assertTrue( metadata.contains( new SimpleMetadatum("ssoar.urn.registration", "false") ) );
LOG.info("---------------------------------------");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment