Project

General

Profile

« Previous | Next » 

Revision 48541

test for wrong openaireid

View differences:

modules/dnet-openaireplus-workflows/trunk/src/test/java/eu/dnetlib/msro/openaireplus/api/objects/ResultEntryTest.java
177 177

  
178 178
	}
179 179

  
180
	@Test
181
	public void testAsIndexRecord_wrongOpenaireId() throws Exception {
180 182

  
183
		final ResultEntry pub =
184
				(new Gson()).fromJson(new InputStreamReader(getClass().getResourceAsStream("test_record_wrong_openaireId.json")), ResultEntry.class);
185

  
186
		final String xml = pub.asOafRecord(ve, lookUpService, "http://oaf/oaf.xsd");
187

  
188
		final Document doc = (new SAXReader()).read(new StringReader(xml));
189

  
190
		final OutputFormat format = OutputFormat.createPrettyPrint();
191

  
192
		final XMLWriter writer = new XMLWriter(System.out, format);
193

  
194
		writer.write(doc);
195

  
196
		/* writer.close(); */
197

  
198
	}
199

  
200

  
181 201
}
modules/dnet-openaireplus-workflows/trunk/src/test/resources/eu/dnetlib/msro/openaireplus/api/objects/test_record_wrong_openaireId.json
1
{
2
  "openaireId":"dedup_wf_001::ab42e811",
3
  "originalId": "ORIG_ID_TEST",
4
  "type": "publication",
5
  "title": "TEST TITLE",
6
  "authors": [
7
	"Michele Artini",
8
	"Claudio Atzori",
9
	"Alessia Bardi"
10
  ],
11
  "publisher": "Test publisher",
12
  "description": "DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION",
13
  "language": "ita",
14
  "pids": [
15
	{
16
	  "type": "doi",
17
	  "value": "10.000/xyz-123"
18
	},
19
	{
20
	  "type": "oai",
21
	  "value": "oai:1234"
22
	}
23
  ],
24
  "licenseCode": "EMBARGO",
25
  "embargoEndDate": "2018-02-02",
26
  "resourceType": "0001",
27
  "url": "http://test.it/xyz",
28
  "collectedFromId": "opendoar____::2659",
29
  "hostedById": "opendoar____::2659",
30
  "linksToProjects": [
31
	"info:eu-repo/grantAgreement/EC/FP7/283595/EU//OpenAIREplus",
32
	"info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work/WorkAble"
33
  ],
34
  "contexts": [
35
	"egi::classification::natsc::math::pure",
36
	"egi::classification::natsc::math::stats"
37
  ]
38
}

Also available in: Unified diff