use of org.globalbioticinteractions.dataset.DatasetWithCache in project eol-globi-data by jhpoelen.
the class DatasetImporterForRSSIT method importVertnet.
@Test
public void importVertnet() throws StudyImporterException, IOException {
File tempFile = File.createTempFile("test", ".tmp", new File("target"));
DatasetImporter importer = new StudyImporterTestFactory(nodeFactory).instantiateImporter(DatasetImporterForRSS.class);
DatasetWithCache datasetWithCache = new DatasetWithCache(new DatasetLocal(inStream -> inStream), new CachePullThrough("testing", tempFile.getParentFile().getAbsolutePath()));
ObjectNode rssUrl = new ObjectMapper().createObjectNode();
rssUrl.put("rss", "http://ipt.vertnet.org:8080/ipt/rss.do");
ObjectNode configNode = new ObjectMapper().createObjectNode();
configNode.set("resources", rssUrl);
datasetWithCache.setConfig(configNode);
importer.setDataset(datasetWithCache);
importStudy(importer);
}
use of org.globalbioticinteractions.dataset.DatasetWithCache in project eol-globi-data by jhpoelen.
the class DatasetImporterForRSSIT method importUCSB.
@Test
public void importUCSB() throws StudyImporterException, IOException {
File tempFile = File.createTempFile("test", ".tmp", new File("target"));
DatasetImporter importer = new StudyImporterTestFactory(nodeFactory).instantiateImporter(DatasetImporterForRSS.class);
final DatasetLocal dataset = new DatasetLocal(inStream -> inStream);
DatasetWithCache datasetWithCache = new DatasetWithCache(dataset, new CachePullThrough("testing", tempFile.getParentFile().getAbsolutePath()));
ObjectNode rssUrl = new ObjectMapper().createObjectNode();
rssUrl.put("rss", "https://symbiota.ccber.ucsb.edu/webservices/dwc/rss.xml");
ObjectNode configNode = new ObjectMapper().createObjectNode();
configNode.set("resources", rssUrl);
datasetWithCache.setConfig(configNode);
importer.setDataset(datasetWithCache);
importStudy(importer);
final Dataset datasetImported = nodeFactory.getOrCreateDataset(dataset);
assertThat(datasetImported.getNamespace(), Is.is("jhpoelen/eol-globidata"));
}
Aggregations