use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubArchive in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplIT method jsonldImporterCached.
@Test
public void jsonldImporterCached() throws StudyImporterException, DatasetRegistryException {
final DatasetRegistry datasetRegistry = new DatasetRegistryWithCache(new DatasetRegistryGitHubArchive(inStream -> inStream), dataset -> CacheUtil.cacheFor(dataset.getNamespace(), "target/datasets", inStream -> inStream));
Dataset dataset = new DatasetFactory(datasetRegistry).datasetFor("globalbioticinteractions/jsonld-template-dataset");
DatasetImporter importer = new StudyImporterFactoryImpl(null).createImporter(dataset);
assertThat(importer, is(notNullValue()));
assertThat(importer, is(instanceOf(DatasetImporterForJSONLD.class)));
}
use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubArchive in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplIT method defaultTSVImporterCached.
@Test
public void defaultTSVImporterCached() throws StudyImporterException, DatasetRegistryException, IOException {
final DatasetRegistry datasetRegistry = new DatasetRegistryWithCache(new DatasetRegistryGitHubArchive(inStream -> inStream), dataset -> CacheUtil.cacheFor(dataset.getNamespace(), "target/datasets", inStream -> inStream));
DatasetImporter importer = getTemplateImporter(datasetRegistry, "globalbioticinteractions/template-dataset");
DatasetImporterForTSV importerTSV = (DatasetImporterForTSV) importer;
assertThat(importerTSV.getBaseUrl(), startsWith("https://github.com/globalbioticinteractions/template-dataset/"));
assertThat(importerTSV.getDataset().retrieve(URI.create("globi.json")), is(notNullValue()));
}
Aggregations