Revision 55761
Added by Claudio Atzori almost 5 years ago
ResultEntryTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.msro.openaireplus.api.objects; |
2 | 2 |
|
3 |
import java.io.InputStreamReader; |
|
4 |
import java.io.StringReader; |
|
5 |
import java.util.ArrayList; |
|
6 |
import java.util.Arrays; |
|
7 |
import java.util.Properties; |
|
8 |
|
|
9 | 3 |
import com.google.gson.Gson; |
10 | 4 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService; |
11 | 5 |
import eu.dnetlib.openaire.directindex.api.DirecIndexApiException; |
... | ... | |
23 | 17 |
import org.mockito.Mock; |
24 | 18 |
import org.mockito.runners.MockitoJUnitRunner; |
25 | 19 |
|
20 |
import java.io.InputStreamReader; |
|
21 |
import java.io.StringReader; |
|
22 |
import java.util.ArrayList; |
|
23 |
import java.util.Arrays; |
|
24 |
import java.util.Properties; |
|
25 |
|
|
26 | 26 |
import static org.mockito.Matchers.anyString; |
27 | 27 |
import static org.mockito.Mockito.when; |
28 | 28 |
|
... | ... | |
186 | 186 |
|
187 | 187 |
} |
188 | 188 |
|
189 |
|
|
190 | 189 |
@Test |
191 | 190 |
public void testAsIndexRecord_json() throws Exception { |
192 | 191 |
testAsIndexRecord_json("test_record.json"); |
... | ... | |
246 | 245 |
final ResultEntry pub = |
247 | 246 |
new Gson().fromJson(new InputStreamReader(getClass().getResourceAsStream(filename)), ResultEntry.class); |
248 | 247 |
|
248 |
|
|
249 | 249 |
final String xml = pub.asOafRecord(ve, lookUpService, "http://oaf/oaf.xsd"); |
250 | 250 |
//System.out.println(xml); |
251 | 251 |
|
... | ... | |
261 | 261 |
} |
262 | 262 |
|
263 | 263 |
@Test |
264 |
public void testAsIndexRecord_json_zenodoProblems()throws Exception{
|
|
265 |
testAsIndexRecord_json("test_zenodo_problems.json");
|
|
264 |
public void testAsIndexRecord_json_zenodocommunities()throws Exception{
|
|
265 |
testAsIndexRecord_json("test_zenodo_community.json");
|
|
266 | 266 |
} |
267 | 267 |
|
268 | 268 |
@Test |
... | ... | |
272 | 272 |
System.out.println(StringEscapeUtils.escapeXml11(unicodeTxt)); |
273 | 273 |
} |
274 | 274 |
|
275 |
|
|
276 |
@Test |
|
277 |
public void testAsIndexRecord_json_zenodocommunities()throws Exception{ |
|
278 |
testAsIndexRecord_json("test_zenodo_community.json"); |
|
279 |
} |
|
280 |
|
|
281 | 275 |
} |
Also available in: Unified diff
reintegrated branch solr75 -r53793:HEAD