AriadnePlus/dnet-ariadneplus/src/test/java/eu/dnetlib/data/collector/plugins/ariadneplus/thanados/ThanadosIteratorTest.java

37 lines
987 B
Java
Raw Normal View History

2022-04-11 18:55:54 +02:00
package eu.dnetlib.data.collector.plugins.ariadneplus.thanados;
2022-04-15 14:42:59 +02:00
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
2022-04-11 18:55:54 +02:00
import org.junit.Ignore;
import org.junit.Test;
2022-04-15 14:42:59 +02:00
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
2022-04-11 18:55:54 +02:00
@Ignore
public class ThanadosIteratorTest {
String sitelist = "https://thanados.net/sites/sitelist";
ThanadosIterator it;
@Test
public void testDownloadList(){
it = new ThanadosIterator("", sitelist);
it.getIdentifiers().stream().forEach(id -> System.out.println(id));
System.out.println(it.getIdentifiers().size());
}
@Test
2022-04-15 14:42:59 +02:00
public void testDownload() throws IOException {
2022-04-11 18:55:54 +02:00
int count = 0;
2022-04-15 14:42:59 +02:00
it = new ThanadosIterator("https://thanados.openatlas.eu/api/0.3/subunits", sitelist);
2022-04-11 18:55:54 +02:00
while(it.hasNext()){
it.next();
count++;
2022-04-15 14:42:59 +02:00
System.out.println(count);
2022-04-11 18:55:54 +02:00
}
2022-04-15 14:42:59 +02:00
System.out.println("DONE");
2022-04-11 18:55:54 +02:00
}
}