Revision 55007
Added by Miriam Baglioni about 5 years ago
modules/dnet-directindex-api/branches/solr75/src/test/java/eu/dnetlib/msro/openaireplus/api/objects/ResultEntryTest.java | ||
---|---|---|
11 | 11 |
import eu.dnetlib.openaire.directindex.api.DirecIndexApiException; |
12 | 12 |
import eu.dnetlib.openaire.directindex.objects.PidEntry; |
13 | 13 |
import eu.dnetlib.openaire.directindex.objects.ResultEntry; |
14 |
import eu.dnetlib.openaire.directindex.objects.ZenodoContextList; |
|
14 | 15 |
import org.apache.commons.lang3.StringEscapeUtils; |
15 | 16 |
import org.apache.velocity.app.VelocityEngine; |
16 | 17 |
import org.dom4j.Document; |
... | ... | |
26 | 27 |
import static org.mockito.Matchers.anyString; |
27 | 28 |
import static org.mockito.Mockito.when; |
28 | 29 |
|
30 |
import org.springframework.web.client.RestTemplate; |
|
29 | 31 |
/** |
30 | 32 |
* Created by michele on 14/12/15. |
31 | 33 |
*/ |
... | ... | |
245 | 247 |
final ResultEntry pub = |
246 | 248 |
new Gson().fromJson(new InputStreamReader(getClass().getResourceAsStream(filename)), ResultEntry.class); |
247 | 249 |
|
250 |
|
|
248 | 251 |
final String xml = pub.asOafRecord(ve, lookUpService, "http://oaf/oaf.xsd"); |
249 | 252 |
System.out.println(xml); |
250 | 253 |
|
... | ... | |
260 | 263 |
} |
261 | 264 |
|
262 | 265 |
@Test |
266 |
public void testAsIndexRecord_json_zenodocommunities()throws Exception{ |
|
267 |
testAsIndexRecord_json("test_zenodo_community.json"); |
|
268 |
} |
|
269 |
|
|
270 |
@Test |
|
263 | 271 |
public void testEscapeUnicode() { |
264 | 272 |
final String unicodeTxt = |
265 | 273 |
"i.e. closed curves of the form $t\ud835\udfc4 [0,2\u03c0] \u21a6 (\\cos t)u + (\\sin t)v$ for suitable orthogonal vectors $u$"; |
modules/dnet-directindex-api/branches/solr75/src/test/resources/eu/dnetlib/msro/openaireplus/api/objects/test_zenodo_community.json | ||
---|---|---|
1 |
{"authors": ["Dag Haug", "Marius J\xf8hndal"], |
|
2 |
"collectedFromId": "re3data_____::r3d100010468", |
|
3 |
"contexts": ["https://zenodo.org/communities/instruct","https://zenodo.org/communities/discardless","pippo","https://zenodo.org/communities/zenodo"], |
|
4 |
"description": "<p>Official releases of the PROIEL treebank of ancient Indo-European languages</p>", |
|
5 |
"hostedById": "re3data_____::r3d100010468", |
|
6 |
"licenseCode": "OPEN", |
|
7 |
"originalId": "10.5281/zenodo.11003", |
|
8 |
"pids": [{"type": "oai", "value": "oai:zenodo.org:11003"}, |
|
9 |
{"type": "doi", "value": "10.5281/zenodo.11003"}], |
|
10 |
"publisher": "Zenodo", |
|
11 |
"resourceType": "0021", |
|
12 |
"title": "proiel-treebank: 20140723 version", |
|
13 |
"type": "dataset", |
|
14 |
"url": "https://zenodo.org/record/11003"} |
Also available in: Unified diff
new test for zenodocommunity remapping to openaire community