Project

General

Profile

« Previous | Next » 

Revision 58449

Added by Andreas Czerniak almost 4 years ago

Rest-Collector plugin: additional log.debug statements

View differences:

modules/dnet-collector-plugins/trunk/src/test/java/eu/dnetlib/data/collector/plugins/rest/RestIteratorTest.java
9 9
/**
10 10
 * 
11 11
 * @author js, Andreas Czerniak
12
 * @date 2018-08-06
12
 * @date 2020-04-08
13 13
 */
14 14
public class RestIteratorTest {
15 15

  
......
22 22
	private String resultFormatParam = "format";
23 23
	private String resultFormatValue = "Json";              //  Change from lowerCase to one UpperCase
24 24
	private String resultSizeParam = "size";
25
        private String resultSizeValue = "10";                  //  add  new
25
    private String resultSizeValue = "10";                  
26
    private String authMethod = "";
27
    private String authToken = "";
28
    private String resultOffsetParam = "cursor";
26 29
	private String query = "q=%28sources%3ASocArXiv+AND+type%3Apreprint%29";
27 30

  
28 31

  
29 32
	@Ignore
30 33
	@Test
31 34
	public void test(){
32
		final RestIterator iterator = new RestIterator(baseUrl, resumptionType, resumptionParam, resumptionXpath, resultTotalXpath, resultFormatParam, resultFormatValue, resultSizeParam, resultSizeValue, query, entityXpath);
35
		final RestIterator iterator = new RestIterator(baseUrl, resumptionType, resumptionParam, resumptionXpath, resultTotalXpath, resultFormatParam, resultFormatValue, resultSizeParam, resultSizeValue, query, entityXpath, authMethod, authToken, resultOffsetParam);
33 36
		int i =20;
34 37
		while (iterator.hasNext() && i > 0) {
35 38
			String result = iterator.next();
modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/rest/RestIterator.java
330 330
				break;
331 331

  
332 332
			case "deep-cursor":   // size of result items unknown, iterate over items  (for supporting deep cursor in solr)
333
				if (resultSizeValue < 2) {throw new CollectorServiceException("Mode: deep-cursor, Param 'resultSizeValue' is less than 2");}
334
				if (resultOffsetParam.length() < 2) {throw new CollectorServiceException("Mode: deep-cursor, Param 'resultOffset' is less than 2");}
333
				// isn't relevant -- if (resultSizeValue < 2) {throw new CollectorServiceException("Mode: deep-cursor, Param 'resultSizeValue' is less than 2");}
334
				// if ( (this.resultOffsetParam.length()) < 2) {throw new CollectorServiceException("Mode: deep-cursor, Param 'resultOffsetParam' is less than 2");}
335 335

  
336 336
				resumptionStr = xprResumptionPath.evaluate(resultNode);
337 337
				queryParams.replace("cursor=*", "");
modules/dnet-collector-plugins/trunk/pom.xml
7 7
	</parent>
8 8
	<groupId>eu.dnetlib</groupId>
9 9
	<artifactId>dnet-collector-plugins</artifactId>
10
	<version>1.3.35-SNAPSHOT</version>
10
	<version>1.3.36-SNAPSHOT</version>
11 11
	<scm>
12 12
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-collector-plugins/trunk</developerConnection>
13 13
	</scm>

Also available in: Unified diff