Commit 19b28d66 authored by Fischer, Tim's avatar Fischer, Tim

Changed test for SAH and renamed test class

parent 9c1ca179
...@@ -27,10 +27,10 @@ import org.junit.Test; ...@@ -27,10 +27,10 @@ import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class XsltTransformerOaiPmhBundlesStreamSourceTest { public class XSLTTransformerTests {
private final static Logger LOG = LoggerFactory.getLogger(XsltTransformerOaiPmhBundlesStreamSourceTest.class); private final static Logger LOG = LoggerFactory.getLogger(XSLTTransformerTests.class);
@Test @Test
public void streamBundles() throws IOException, URISyntaxException { public void streamBundles() throws IOException, URISyntaxException {
...@@ -1396,7 +1396,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest { ...@@ -1396,7 +1396,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() ); assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() ); // assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v3i1.96") ) ); assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v3i1.96") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "IRL") ) ); assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "MISC") ) );
Set<InputStream> fileSet = bundle.getContents(); Set<InputStream> fileSet = bundle.getContents();
assertTrue( fileSet.size() == 1); assertTrue( fileSet.size() == 1);
...@@ -1484,7 +1484,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest { ...@@ -1484,7 +1484,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() ); assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() ); // assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title.alternative") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v7i1.198") ) ); assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.18193/sah.v7i1.198") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "IRL") ) ); assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "MISC") ) );
assertTrue( metadata.contains( new SimpleMetadatum("ssoar.urn.registration", "false") ) ); assertTrue( metadata.contains( new SimpleMetadatum("ssoar.urn.registration", "false") ) );
fileSet = bundle.getContents(); fileSet = bundle.getContents();
...@@ -2301,13 +2301,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest { ...@@ -2301,13 +2301,7 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
@Test @Test
public void getSinglePublicationFqs() throws IOException { public void getSinglePublicationFqs() throws IOException {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
// String xMetaDissPlusXsltString = IOUtils.toString( String oaiDcXsltString = IOUtils.toString(
// getClass().
// getClassLoader().
// getResourceAsStream("xslt/fqs-nlm-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
// map.put("nlm", xMetaDissPlusXsltString);
String oaiDcXsltString = IOUtils.toString(
getClass(). getClass().
getClassLoader(). getClassLoader().
getResourceAsStream("xslt/fqs-oai_dc-2-xmlbundle_test1.xslt"), StandardCharsets.UTF_8); getResourceAsStream("xslt/fqs-oai_dc-2-xmlbundle_test1.xslt"), StandardCharsets.UTF_8);
......
This diff is collapsed.
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