Revision 46796
Added by Alessia Bardi over 7 years ago
modules/dnet-data-services/branches/saxonHE/src/test/java/eu/dnetlib/data/collector/plugins/sftp/SftpPubKeyCollectorPluginTest.java | ||
---|---|---|
4 | 4 |
import eu.dnetlib.rmi.data.InterfaceDescriptor; |
5 | 5 |
import org.junit.Assert; |
6 | 6 |
import org.junit.Before; |
7 |
import org.junit.Ignore; |
|
8 | 7 |
import org.junit.Test; |
9 | 8 |
import org.junit.runner.RunWith; |
10 | 9 |
import org.springframework.beans.factory.annotation.Autowired; |
... | ... | |
22 | 21 |
@Autowired |
23 | 22 |
private SftpPubKeyCollectorPlugin plugin; |
24 | 23 |
private InterfaceDescriptor apiDescriptor; |
24 |
private int max_records = 10; |
|
25 | 25 |
|
26 | 26 |
@Before |
27 | 27 |
public void prepare(){ |
28 | 28 |
apiDescriptor = new InterfaceDescriptor(); |
29 |
apiDescriptor.setBaseUrl("sftp://ariadne2.isti.cnr.it/ariadneTest");
|
|
29 |
apiDescriptor.setBaseUrl("sftp://ariadne2.isti.cnr.it/../../data/transform/acdm_correct");
|
|
30 | 30 |
apiDescriptor.setProtocol("sftp"); |
31 | 31 |
apiDescriptor.setId("testSFTP"); |
32 |
apiDescriptor.getParams().put("recursive", "false");
|
|
32 |
apiDescriptor.getParams().put("recursive", "true");
|
|
33 | 33 |
apiDescriptor.getParams().put("extensions", "xml"); |
34 | 34 |
apiDescriptor.getParams().put("username", "alessia"); |
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
@Test |
38 |
public void testWithAriadneServerNorecursive() throws CollectorServiceException {
|
|
38 |
public void testWithAriadneServer() throws CollectorServiceException { |
|
39 | 39 |
|
40 | 40 |
Iterable<String> res = plugin.collect(apiDescriptor, null, null); |
41 | 41 |
Assert.assertNotNull(res); |
42 |
int i =0; |
|
42 | 43 |
for(String r : res){ |
44 |
i++; |
|
43 | 45 |
Assert.assertNotNull(r); |
44 |
System.out.println(r);
|
|
46 |
if(i > max_records) break;
|
|
45 | 47 |
} |
46 | 48 |
|
47 | 49 |
} |
Also available in: Unified diff
limit number of files to be downloaded from ariadne (test is ignored anyway)