Search in sources :

Example 1 with StudyImporter

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

the class GitHubImporterFactoryIT method createSIAD.

@Test
public void createSIAD() throws StudyImporterException, DatasetFinderException {
    final DatasetFinderGitHubRemote datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    StudyImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/siad");
    assertThat(importer, is(notNullValue()));
    Dataset dataset = ((BaseStudyImporter) importer).getDataset();
    final JsonNode config = dataset.getConfig();
    assertThat(config, is(notNullValue()));
    assertThat(dataset.getOrDefault(DatasetConstant.SHOULD_RESOLVE_REFERENCES, "donald"), is("false"));
}
Also used : JsonNode(org.codehaus.jackson.JsonNode) BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) Test(org.junit.Test)

Example 2 with StudyImporter

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

the class GitHubImporterFactoryIT method createArthopodEasyCapture.

@Test
public void createArthopodEasyCapture() throws StudyImporterException, DatasetFinderException {
    final DatasetFinderGitHubRemote datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    StudyImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/arthropodEasyCaptureAMNH");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForArthopodEasyCapture.class)));
    assertThat(((StudyImporterForArthopodEasyCapture) importer).getRssFeedUrlString(), is(notNullValue()));
}
Also used : BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) Test(org.junit.Test)

Example 3 with StudyImporter

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

the class GitHubImporterFactoryIT method getTemplateImporter.

StudyImporter getTemplateImporter(DatasetFinder datasetFinder, String repo) throws DatasetFinderException, StudyImporterException {
    Dataset dataset = DatasetFactory.datasetFor(repo, datasetFinder);
    StudyImporter importer = new GitHubImporterFactory().createImporter(dataset, null);
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForTSV.class)));
    return importer;
}
Also used : BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter)

Example 4 with StudyImporter

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

the class GitHubImporterFactoryIT method createAfrotropicalBees.

@Test
public void createAfrotropicalBees() throws StudyImporterException, DatasetFinderException {
    final DatasetFinderGitHubRemote datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    String repo = "globalbioticinteractions/Catalogue-of-Afrotropical-Bees";
    StudyImporter importer = importerFor(datasetFinderGitHubRemote, repo);
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForCoetzer.class)));
    assertThat(((StudyImporterForCoetzer) importer).getDataset(), is(notNullValue()));
    String archiveURL = ((StudyImporterForCoetzer) importer).getResourceArchiveURI();
    assertThat(archiveURL, endsWith("CatalogueOfAfrotropicalBees.zip"));
    assertThat(URI.create(archiveURL).isAbsolute(), is(true));
}
Also used : StudyImporterForCoetzer(org.eol.globi.data.StudyImporterForCoetzer) 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 5 with StudyImporter

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

the class GitHubImporterFactoryIT method createHafner.

@Test
public void createHafner() throws StudyImporterException, DatasetFinderException {
    final DatasetFinder datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    StudyImporter importer = new GitHubImporterFactory().createImporter(DatasetFactory.datasetFor("globalbioticinteractions/hafner", datasetFinderGitHubRemote), null);
    assertThat(importer, is(notNullValue()));
    StudyImporterForHafner gomexsiImporter = (StudyImporterForHafner) importer;
    assertThat(gomexsiImporter.getDataset().getResourceURI("hafner/gopher_lice_int.csv"), is("gopher_lice_int.csv"));
}
Also used : BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) StudyImporterForHafner(org.eol.globi.data.StudyImporterForHafner) Test(org.junit.Test)

Aggregations

StudyImporter (org.eol.globi.data.StudyImporter)20 BaseStudyImporter (org.eol.globi.data.BaseStudyImporter)16 Test (org.junit.Test)15 JsonNode (org.codehaus.jackson.JsonNode)3 StudyImporterForTSV (org.eol.globi.data.StudyImporterForTSV)3 DatasetFinderWithCache (org.globalbioticinteractions.dataset.DatasetFinderWithCache)3 StringContains.containsString (org.junit.internal.matchers.StringContains.containsString)3 StudyImporterException (org.eol.globi.data.StudyImporterException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 BasicParser (org.apache.commons.cli.BasicParser)1 CommandLine (org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.commons.cli.CommandLineParser)1 HelpFormatter (org.apache.commons.cli.HelpFormatter)1 Option (org.apache.commons.cli.Option)1 Options (org.apache.commons.cli.Options)1