use of org.eol.globi.data.DatasetImporter in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplIT method createHafner.
@Test
public void createHafner() throws StudyImporterException, DatasetRegistryException, IOException {
final DatasetRegistry datasetRegistryGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
Dataset dataset = new DatasetFactory(datasetRegistryGitHubRemote).datasetFor("globalbioticinteractions/hafner");
DatasetImporter importer = new StudyImporterFactoryImpl(null).createImporter(dataset);
assertThat(importer, is(notNullValue()));
DatasetImporterForHafner haftnerImporter = (DatasetImporterForHafner) importer;
assertThat(haftnerImporter.getDataset().retrieve(URI.create("hafner/gopher_lice_int.csv")), is(notNullValue()));
}
use of org.eol.globi.data.DatasetImporter in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplIT method createAfrotropicalBees.
@Test
public void createAfrotropicalBees() throws StudyImporterException, DatasetRegistryException, IOException {
final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
String repo = "globalbioticinteractions/Catalogue-of-Afrotropical-Bees";
DatasetImporter importer = importerFor(datasetFinderGitHubRemote, repo);
assertThat(importer, is(notNullValue()));
assertThat(importer, is(instanceOf(DatasetImporterForCoetzer.class)));
assertThat(((DatasetImporterForCoetzer) importer).getDataset(), is(notNullValue()));
assertThat(((DatasetImporterForCoetzer) importer).getDataset().retrieve(URI.create("archive")), is(notNullValue()));
}
use of org.eol.globi.data.DatasetImporter in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplIT method defaultTSVImporterCachedZenodo.
@Test
public void defaultTSVImporterCachedZenodo() throws StudyImporterException, DatasetRegistryException {
final DatasetRegistry datasetRegistry = new DatasetRegistryWithCache(new DatasetRegistryZenodo(inStream -> inStream), dataset -> CacheUtil.cacheFor(dataset.getNamespace(), "target/datasets", inStream -> inStream));
DatasetImporter importer = getTemplateImporter(datasetRegistry, "globalbioticinteractions/template-dataset");
DatasetImporterForTSV importerTSV = (DatasetImporterForTSV) importer;
assertThat(importerTSV.getSourceCitation(), containsString("doi.org"));
}
use of org.eol.globi.data.DatasetImporter in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplIT method createArthopodEasyCapture.
@Test
public void createArthopodEasyCapture() throws StudyImporterException, DatasetRegistryException {
final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/arthropodEasyCaptureAMNH");
assertThat(importer, is(notNullValue()));
assertThat(importer, is(instanceOf(DatasetImporterForRSS.class)));
assertThat(((DatasetImporterForRSS) importer).getRssFeedUrlString(), is(notNullValue()));
}
use of org.eol.globi.data.DatasetImporter in project eol-globi-data by jhpoelen.
the class NodeFactoryTest method importData.
private static void importData(Class<? extends DatasetImporter> importer, NodeFactory factory) throws StudyImporterException {
DatasetImporter datasetImporter = createStudyImporter(importer, factory);
LOG.info("[" + importer + "] importing ...");
datasetImporter.importStudy();
LOG.info("[" + importer + "] imported.");
}
Aggregations