1
|
package eu.dnetlib.data.collector.plugins.fairsharing;
|
2
|
|
3
|
import java.util.concurrent.atomic.AtomicLong;
|
4
|
|
5
|
import org.junit.Before;
|
6
|
import org.junit.Ignore;
|
7
|
import org.junit.Test;
|
8
|
|
9
|
import eu.dnetlib.data.collector.rmi.CollectorServiceException;
|
10
|
import eu.dnetlib.data.collector.rmi.InterfaceDescriptor;
|
11
|
|
12
|
@Ignore
|
13
|
public class FairSharingPluginTest {
|
14
|
|
15
|
private FairSharingPlugin plugin;
|
16
|
private InterfaceDescriptor ifcDescr;
|
17
|
|
18
|
@Before
|
19
|
public void setUp() throws Exception {
|
20
|
plugin = new FairSharingPlugin();
|
21
|
ifcDescr = new InterfaceDescriptor();
|
22
|
ifcDescr.setBaseUrl("https://api.fairsharing.org");
|
23
|
ifcDescr.getParams().put("login", "");
|
24
|
ifcDescr.getParams().put("password", "");
|
25
|
}
|
26
|
|
27
|
@Test
|
28
|
public void testDownload() throws CollectorServiceException {
|
29
|
final AtomicLong count = new AtomicLong(0);
|
30
|
plugin.collect(ifcDescr, null, null).forEach(s -> {
|
31
|
// System.out.println(s);
|
32
|
final long x = count.incrementAndGet();
|
33
|
if (x % 100 == 0) {
|
34
|
System.out.println(x);
|
35
|
}
|
36
|
});
|
37
|
|
38
|
System.out.println("TOTAL: " + count.get());
|
39
|
}
|
40
|
|
41
|
}
|