Project

General

Profile

« Previous | Next » 

Revision 59804

removed check for same RT from one call to the other (no specification say that it must be different) Left the check that at least one element named record should be present in the returned list

View differences:

modules/dnet-modular-collector-service/trunk/src/test/java/eu/dnetlib/data/collector/plugins/oai/OaiCollectorPluginRealTest.java
12 12

  
13 13
	private OaiCollectorPlugin oai;
14 14

  
15
	private static final String BASE_URL = "http://oai.d.efg.research-infrastructures.eu/oai.do";
16
	private static final String FORMAT = "oai_dc";
17
	private static final String SETS = "d937bab1-d44c-44aa-bf7d-df5312a3b623, e5b14959-1e87-4c07-9f85-942c9cdd9136, 13302eb6-764a-4ed2-8d08-2a1c9526f442, 31701e97-096f-4266-81b5-30b9bc3a06b0";
15
//	private static final String BASE_URL = "http://oai.d.efg.research-infrastructures.eu/oai.do";
16
//	private static final String FORMAT = "oai_dc";
17
//	private static final String SETS = "d937bab1-d44c-44aa-bf7d-df5312a3b623, e5b14959-1e87-4c07-9f85-942c9cdd9136, 13302eb6-764a-4ed2-8d08-2a1c9526f442, 31701e97-096f-4266-81b5-30b9bc3a06b0";
18 18

  
19
	private static final String BASE_URL = "https://dev.textgridlab.org/1.0/tgoaipmh/oai";
20
	//private static final String BASE_URL = "https://rifj.ifj.edu.pl/oai/request";
21
	private static final String FORMAT = "oai_datacite";
22
	//private static final String FORMAT = "oai_dc";
23
	private static final String SETS = "";
24

  
19 25
	@Before
20 26
	public void setUp() {
21 27
		oai = new OaiCollectorPlugin();
modules/dnet-modular-collector-service/trunk/src/main/java/eu/dnetlib/data/collector/plugins/oai/OaiIterator.java
35 35
	private String token;
36 36
	private boolean started;
37 37
	private HttpConnector httpConnector;
38
	private String prev_token = null;
39 38

  
40 39
	public OaiIterator(final String baseUrl, final String mdFormat, final String set, final String fromDate, final String untilDate, final HttpConnector httpConnector) {
41 40
		this.baseUrl = baseUrl;
......
52 51
			this.started = true;
53 52
			try {
54 53
				this.token = firstPage();
55
				prev_token = token;
56 54
			} catch (CollectorServiceException e) {
57 55
				throw new RuntimeException(e);
58 56
			}
......
75 73
			while (queue.isEmpty() && (token != null) && !token.isEmpty()) {
76 74
				try {
77 75
					token = otherPages(token);
78
					if(prev_token.equals(token)){
79
						throw new RuntimeException("OAI Iterator Exception: got the same resumption token twice");
80
					}
81
					prev_token = token;
82 76
				} catch (CollectorServiceException e) {
83 77
					throw new RuntimeException(e);
84 78
				}

Also available in: Unified diff