Search in sources :

Example 1 with StudyImporterForTSV

use of org.eol.globi.data.StudyImporterForTSV 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 2 with StudyImporterForTSV

use of org.eol.globi.data.StudyImporterForTSV in project eol-globi-data by jhpoelen.

the class GitHubImporterFactoryIT method defaultTSVImporterNotCached.

@Test
public void defaultTSVImporterNotCached() throws StudyImporterException, DatasetFinderException {
    final DatasetFinder datasetFinder = new DatasetFinderGitHubRemote();
    StudyImporter importer = getTemplateImporter(datasetFinder, "globalbioticinteractions/template-dataset");
    assertThat(((StudyImporterForTSV) importer).getBaseUrl(), startsWith("https://raw.githubusercontent.com/globalbioticinteractions/template-dataset/"));
    String actual = ((StudyImporterForTSV) importer).getDataset().getResourceURI("this/is/relative").toString();
    assertThat(actual, startsWith("https:/"));
    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) Test(org.junit.Test)

Example 3 with StudyImporterForTSV

use of org.eol.globi.data.StudyImporterForTSV 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 StudyImporterForTSV (org.eol.globi.data.StudyImporterForTSV)3 Test (org.junit.Test)3 DatasetFinderWithCache (org.globalbioticinteractions.dataset.DatasetFinderWithCache)2 StringContains.containsString (org.junit.internal.matchers.StringContains.containsString)2