Project

General

Profile

« Previous | Next » 

Revision 53686

Testing submission of software and orp.

View differences:

modules/dnet-directindex-api/trunk/src/test/java/eu/dnetlib/msro/openaireplus/api/objects/ResultEntryTest.java
50 50
		when(lookUpService.quickSearchProfile(anyString())).thenAnswer(invocation -> {
51 51
			final String query = invocation.getArguments()[0].toString();
52 52
			if (query.contains("dnet:result_typologies")) {
53
				return Arrays.asList("publication @@@ publication", "dataset @@@ dataset");
53
				return Arrays.asList("publication @@@ publication", "dataset @@@ dataset", "software @@@ software", "other @@@ other");
54 54
			} else if (query.contains("dnet:access_modes")) {
55 55
				return Arrays.asList("OPEN @@@ Open Access");
56 56
			} else if (query.contains("dnet:publication_resource")) {
......
190 190

  
191 191
	}
192 192

  
193
	@Test
194
	public void testAsIndexRecord_json_software() throws Exception {
195

  
196
		testAsIndexRecord_json("test_record_software.json");
197

  
198
	}
199

  
200
	@Test
201
	public void testAsIndexRecord_json_orp() throws Exception {
202

  
203
		testAsIndexRecord_json("test_record_orp.json");
204

  
205
	}
206

  
193 207
	private void testAsIndexRecord_json(final String filename) throws Exception {
194 208
		final ResultEntry pub =
195 209
				new Gson().fromJson(new InputStreamReader(getClass().getResourceAsStream(filename)), ResultEntry.class);
modules/dnet-directindex-api/trunk/src/test/resources/eu/dnetlib/msro/openaireplus/api/objects/test_record_software.json
1
{
2
  "openaireId":"od_______278::d5b39693ac6c2197e8cf48008a982951",
3
  "originalId": "oai:rudar.ruc.dk:1800/24691",
4
  "type": "software",
5
  "title": "Software test",
6
  "authors": [
7
	"Sloan, Patrick Alexander Raaby",
8
	"Strange, Gustav Valdemar"
9
  ],
10
  "publisher": "",
11
  "description": "This is for testing software",
12
  "language": "eng",
13
  "pids": [],
14
  "licenseCode": "OPEN SOURCE",
15
  "resourceType": "0000",
16
  "url": "http://rudar.ruc.dk/handle/1800/24691",
17
  "collectedFromId": "opendoar____::278",
18
  "hostedById": "opendoar____::278",
19
  "linksToProjects": [],
20
  "contexts": []
21
}
modules/dnet-directindex-api/trunk/src/test/resources/eu/dnetlib/msro/openaireplus/api/objects/test_record_orp.json
1
{
2
  "openaireId":"od_______278::d5b39693ac6c2197e8cf48008a982951",
3
  "originalId": "oai:rudar.ruc.dk:1800/24691",
4
  "type": "other",
5
  "title": "Other test record",
6
  "authors": [
7
    "Sloan, Patrick Alexander Raaby",
8
    "Strange, Gustav Valdemar"
9
  ],
10
  "publisher": "",
11
  "description": "This is for testing software",
12
  "language": "eng",
13
  "pids": [],
14
  "licenseCode": "OPEN SOURCE",
15
  "resourceType": "0000",
16
  "url": "http://rudar.ruc.dk/handle/1800/24691",
17
  "collectedFromId": "opendoar____::278",
18
  "hostedById": "opendoar____::278",
19
  "linksToProjects": [],
20
  "contexts": []
21
}

Also available in: Unified diff