Project

General

Profile

« Previous | Next » 

Revision 47238

Fixed test now that we use Iterators for the EHRI collector plugin

View differences:

modules/dnet-parthenos/trunk/src/test/java/eu/dnetlib/data/collector/plugins/parthenos/ehri/EHRIGraphQLClientTest.java
5 5
import java.net.URISyntaxException;
6 6
import java.net.URL;
7 7
import java.util.Iterator;
8
import java.util.List;
9 8

  
10 9
import eu.dnetlib.rmi.data.CollectorServiceException;
11 10
import org.apache.commons.io.IOUtils;
......
37 36

  
38 37
	@Test
39 38
	public void testGetIdentifiers() throws IOException {
40
		List<String> it = client.getIdentifiers(new InputStreamReader(IOUtils.toInputStream(simpleOutput, "UTF-8")));
41
		for(String s : it){
42
			System.out.println(s);
43
		}
39
		Iterator<String> it = client.getIdentifiers(new InputStreamReader(IOUtils.toInputStream(simpleOutput, "UTF-8")));
40
		while(it.hasNext())
41
			System.out.println(it.next());
44 42
	}
45 43

  
46 44
	@Ignore
47 45
	@Test
48 46
	public void testRemoteCollect() throws CollectorServiceException, IOException, URISyntaxException {
49
		Iterator<String> it =client.collect(baseUrl, query).iterator();
47
		Iterator<String> it =client.collect(baseUrl, query);
50 48
		int stopAt = 5;
51 49
		for(int i = 0; i < stopAt && it.hasNext(); i++){
52 50
			System.out.println(it.next());

Also available in: Unified diff