Project

General

Profile

« Previous | Next » 

Revision 60477

Debugging error on hostedby for ERC record

View differences:

modules/dnet-openaireplus-workflows/trunk/src/test/java/eu/dnetlib/msro/openaireplus/workflows/nodes/hostedby/PatchHostedByTest.java
1 1
package eu.dnetlib.msro.openaireplus.workflows.nodes.hostedby;
2 2

  
3 3
import java.io.IOException;
4
import java.lang.annotation.Documented;
5 4
import java.nio.charset.StandardCharsets;
6 5
import java.util.HashMap;
7 6

  
......
20 19
	private Resource xmlInput = new ClassPathResource("/eu/dnetlib/msro/openaireplus/workflows/nodes/hostedby/input.xml");
21 20
	private Resource xmlInput2 = new ClassPathResource("/eu/dnetlib/msro/openaireplus/workflows/nodes/hostedby/input2.xml");
22 21
	private Resource xmlInput3 = new ClassPathResource("/eu/dnetlib/msro/openaireplus/workflows/nodes/hostedby/input3.xml");
22
	private Resource xmlInputFails = new ClassPathResource("/eu/dnetlib/msro/openaireplus/workflows/nodes/hostedby/inputFails.xml");
23 23

  
24

  
24 25
	private final SAXReader reader = new SAXReader();
25 26

  
26 27
	private final String xpath = "substring-after(//*[local-name()='supplementTo']/*[local-name()='source']/@id,'.')";
......
44 45

  
45 46
	}
46 47

  
48
	@Test
49
	public void testInputFails() throws Exception{
50
		HashMap<String, HostedByEntry> map = Maps.newHashMap();
51
		map.put("0035-8711", new HostedByEntry("crossref::0035-8711", "Monthly Notices of the Royal Astronomical Society - RIGHT"));
52
		PatchHostedBy phb = new PatchHostedBy(map,"//*[local-name()='journal']/@issn", new HostedByCounters());
53
		String res = phb.evaluate(IOUtils.toString(xmlInputFails.getInputStream(), StandardCharsets.UTF_8));
54
	}
55

  
47 56
}
modules/dnet-openaireplus-workflows/trunk/src/test/resources/eu/dnetlib/msro/openaireplus/workflows/nodes/hostedby/inputFails.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<record xmlns:ac="org.apache.commons.lang.StringEscapeUtils"
3
        xmlns:oaf="http://namespace.openaire.eu/oaf"
4
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
        xmlns:dri="http://www.driver-repository.eu/namespace/dri"
6
        xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
7
        xmlns:dr="http://www.driver-repository.eu/namespace/dr"
8
        xmlns:dc="http://purl.org/dc/elements/1.1/"
9
        xmlns:cr="http://www.crossref.org/qrschema/2.0">
10
    <header xmlns="http://namespace.openaire.eu/">
11
        <dri:objIdentifier>erc_________::278d671cf00037603a357d2a6da92c08</dri:objIdentifier>
12
        <dri:recordIdentifier>204559</dri:recordIdentifier>
13
        <dri:dateOfCollection/>
14
        <dri:mdFormat/>
15
        <dri:mdFormatInterpretation/>
16
        <dri:repositoryId>fe8edde0-3675-414b-b8a6-a7d7a3e988bd_UmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZXMvUmVwb3NpdG9yeVNlcnZpY2VSZXNvdXJjZVR5cGU=</dri:repositoryId>
17
        <dr:objectIdentifier/>
18
        <dr:dateOfCollection>2017-01-03T14:03:40.217Z</dr:dateOfCollection>
19
        <dr:dateOfTransformation/>
20
        <oaf:datasourceprefix>erc_________</oaf:datasourceprefix>
21
    </header>
22
    <metadata xmlns="http://namespace.openaire.eu/">
23
        <dc:title>The mass-metallicity-star formation rate relation at $&#8;oldsymbol {z gtrsim 2}$ with 3D Hubble Space Telescope</dc:title>
24
        <dc:creator>Cullen, F.</dc:creator>
25
        <dc:creator>Cirasuolo, M.</dc:creator>
26
        <dc:creator>McLure, R. J.</dc:creator>
27
        <dc:creator>Dunlop, J. S.</dc:creator>
28
        <dc:creator>Bowler, R. A. A.</dc:creator>
29
        <dc:date>2014-05-21+02:00</dc:date>
30
        <dc:identifier>http://dx.doi.org/10.1093/mnras/stu443</dc:identifier>
31
        <dc:language>eng</dc:language>
32
        <dc:source>Monthly Notices of the Royal Astronomical Society</dc:source>
33
        <dc:subject/>
34
        <dc:type>journal_article</dc:type>
35
        <dr:CobjCategory type="publication">0001</dr:CobjCategory>
36
        <dr:CobjIdentifier/>
37
        <oaf:dateAccepted>2014-05-21</oaf:dateAccepted>
38
        <oaf:projectid validationDate="2017-01-03T14:03:40.217Z">corda_______::247373</oaf:projectid>
39
        <oaf:collectedDatasourceid>openaire____::erc</oaf:collectedDatasourceid>
40
        <oaf:accessrights>CLOSED</oaf:accessrights>
41
        <oaf:hostedBy name="Unknown Repository"
42
                      id="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18"/>
43
        <oaf:collectedFrom name="European Research Council (ERC)" id="openaire____::erc"/>
44
        <oaf:identifier identifierType="doi">10.1093/mnras/stu443</oaf:identifier>
45
        <oaf:journal issn="0035-8711">Monthly Notices of the Royal Astronomical Society</oaf:journal>
46
    </metadata>
47
    <about xmlns="http://namespace.openaire.eu/"
48
           xmlns:oai="http://www.openarchives.org/OAI/2.0/">
49
        <provenance xmlns="http://www.openarchives.org/OAI/2.0/provenance"
50
                    xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/provenance http://www.openarchives.org/OAI/2.0/provenance.xsd">
51
            <originDescription harvestDate="2017-01-03T14:03:40.217Z" altered="true">
52
                <baseURL>file:///var/lib/dnet/data/erc/PUB_REPORTED_PATCHED.xml</baseURL>
53
                <identifier/>
54
                <datestamp/>
55
                <metadataNamespace/>
56
            </originDescription>
57
        </provenance>
58
        <oaf:datainfo>
59
            <oaf:inferred>false</oaf:inferred>
60
            <oaf:deletedbyinference>false</oaf:deletedbyinference>
61
            <oaf:trust>0.9</oaf:trust>
62
            <oaf:inferenceprovenance/>
63
            <oaf:provenanceaction schemename="dnet:provenanceActions" schemeid="dnet:provenanceActions"
64
                                  classname="sysimport:crosswalk:repository"
65
                                  classid="sysimport:crosswalk:repository"/>
66
        </oaf:datainfo>
67
    </about>
68
</record>

Also available in: Unified diff