Search in sources :

Example 1 with DatasetFinderWithCache

use of org.globalbioticinteractions.dataset.DatasetFinderWithCache in project eol-globi-data by jhpoelen.

the class GitHubImporterFactoryIT method jsonldImporterCached.

@Test
public void jsonldImporterCached() throws StudyImporterException, DatasetFinderException {
    final DatasetFinder datasetFinder = new DatasetFinderWithCache(new DatasetFinderGitHubArchive());
    Dataset dataset = DatasetFactory.datasetFor("globalbioticinteractions/jsonld-template-dataset", datasetFinder);
    StudyImporter importer = new GitHubImporterFactory().createImporter(dataset, null);
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForJSONLD.class)));
}
Also used : BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) DatasetFinderWithCache(org.globalbioticinteractions.dataset.DatasetFinderWithCache) Test(org.junit.Test)

Example 2 with DatasetFinderWithCache

use of org.globalbioticinteractions.dataset.DatasetFinderWithCache in project eol-globi-data by jhpoelen.

the class GitHubImporterFactoryIT method defaultTSVImporterCached.

@Test
public void defaultTSVImporterCached() throws StudyImporterException, DatasetFinderException {
    final DatasetFinder datasetFinder = new DatasetFinderWithCache(new DatasetFinderGitHubArchive());
    StudyImporter importer = getTemplateImporter(datasetFinder, "globalbioticinteractions/template-dataset");
    StudyImporterForTSV importerTSV = (StudyImporterForTSV) importer;
    assertThat(importerTSV.getBaseUrl(), startsWith("https://github.com/globalbioticinteractions/template-dataset/"));
    String actual = importerTSV.getDataset().getResourceURI("this/is/relative").toString();
    assertThat(actual, startsWith("jar:file:"));
    assertThat(actual, endsWith("this/is/relative"));
}
Also used : StudyImporterForTSV(org.eol.globi.data.StudyImporterForTSV) StringContains.containsString(org.junit.internal.matchers.StringContains.containsString) BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) DatasetFinderWithCache(org.globalbioticinteractions.dataset.DatasetFinderWithCache) Test(org.junit.Test)

Example 3 with DatasetFinderWithCache

use of org.globalbioticinteractions.dataset.DatasetFinderWithCache in project eol-globi-data by jhpoelen.

the class GitHubImporterFactoryIT method defaultTSVImporterCachedZenodo.

@Test
public void defaultTSVImporterCachedZenodo() throws StudyImporterException, DatasetFinderException {
    final DatasetFinder datasetFinder = new DatasetFinderWithCache(new DatasetFinderZenodo());
    StudyImporter importer = getTemplateImporter(datasetFinder, "globalbioticinteractions/template-dataset");
    StudyImporterForTSV importerTSV = (StudyImporterForTSV) importer;
    assertThat(importerTSV.getSourceCitation(), containsString("doi.org"));
}
Also used : StudyImporterForTSV(org.eol.globi.data.StudyImporterForTSV) BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) DatasetFinderWithCache(org.globalbioticinteractions.dataset.DatasetFinderWithCache) Test(org.junit.Test)

Aggregations

BaseStudyImporter (org.eol.globi.data.BaseStudyImporter)3 StudyImporter (org.eol.globi.data.StudyImporter)3 DatasetFinderWithCache (org.globalbioticinteractions.dataset.DatasetFinderWithCache)3 Test (org.junit.Test)3 StudyImporterForTSV (org.eol.globi.data.StudyImporterForTSV)2 StringContains.containsString (org.junit.internal.matchers.StringContains.containsString)1