Revision 50070
Added by Jochen Schirrwagen over 6 years ago
RestIteratorTest.java | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
package eu.dnetlib.data.collector.plugins.rest; |
5 | 5 |
|
6 |
import java.io.FileWriter; |
|
7 |
|
|
6 |
import org.junit.Ignore; |
|
8 | 7 |
import org.junit.Test; |
9 | 8 |
|
10 | 9 |
/** |
... | ... | |
21 | 20 |
private String resultFormatParam = "format"; |
22 | 21 |
private String resultFormatValue = "json"; |
23 | 22 |
private String resultSizeParam = "size"; |
24 |
private int resultSizeValue = 100; |
|
25 | 23 |
private String query = "q=%28sources%3ASocArXiv+AND+type%3Apreprint%29"; |
26 | 24 |
|
27 | 25 |
|
26 |
@Ignore |
|
28 | 27 |
@Test |
29 | 28 |
public void test(){ |
30 |
final RestIterator iterator = new RestIterator(baseUrl, resumptionType, resumptionParam, resumptionXpath, resultTotalXpath, resultFormatParam, resultFormatValue, resultSizeParam, resultSizeValue, query);
|
|
29 |
final RestIterator iterator = new RestIterator(baseUrl, resumptionType, resumptionParam, resumptionXpath, resultTotalXpath, resultFormatParam, resultFormatValue, resultSizeParam, query); |
|
31 | 30 |
int i =20; |
32 | 31 |
while (iterator.hasNext() && i > 0) { |
33 | 32 |
String result = iterator.next(); |
34 |
// try { |
|
35 |
// FileWriter writer = new FileWriter("/tmp/" + i + ".xml"); |
|
36 |
// writer.write(result); |
|
37 |
// writer.close(); |
|
38 |
// }catch(Exception e) { |
|
39 |
// e.printStackTrace(); |
|
40 |
// } |
|
41 | 33 |
|
42 | 34 |
i--; |
43 | 35 |
} |
Also available in: Unified diff
declaring bean for RestCollectorPlugin