Search in sources :

Example 6 with DatasetRegistryGitHubRemote

use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote 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()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 7 with DatasetRegistryGitHubRemote

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

the class DatasetImporterFactoryImplIT method defaultTSVImporterNotCached.

@Test
public void defaultTSVImporterNotCached() throws StudyImporterException, DatasetRegistryException, IOException {
    final DatasetRegistry datasetRegistry = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = getTemplateImporter(datasetRegistry, "globalbioticinteractions/template-dataset");
    assertThat(((DatasetImporterForTSV) importer).getBaseUrl(), startsWith("https://raw.githubusercontent.com/globalbioticinteractions/template-dataset/"));
    InputStream actual = ((DatasetImporterForTSV) importer).getDataset().retrieve(URI.create("globi.json"));
    assertThat(actual, is(notNullValue()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) InputStream(java.io.InputStream) DatasetRegistry(org.globalbioticinteractions.dataset.DatasetRegistry) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 8 with DatasetRegistryGitHubRemote

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

the class DatasetImporterFactoryImplIT method createSIAD.

@Test
public void createSIAD() throws StudyImporterException, DatasetRegistryException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/siad");
    assertThat(importer, is(notNullValue()));
    Dataset dataset = ((BaseDatasetImporter) importer).getDataset();
    final JsonNode config = dataset.getConfig();
    assertThat(config, is(notNullValue()));
    assertThat(dataset.getOrDefault(DatasetConstant.SHOULD_RESOLVE_REFERENCES, "donald"), is("false"));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) Dataset(org.globalbioticinteractions.dataset.Dataset) JsonNode(com.fasterxml.jackson.databind.JsonNode) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) Test(org.junit.Test)

Example 9 with DatasetRegistryGitHubRemote

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

the class DatasetImporterFactoryImplIT method createSzoboszlai.

@Test
public void createSzoboszlai() throws StudyImporterException, DatasetRegistryException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/szoboszlai2015");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForSzoboszlai.class)));
    DatasetImporterForSzoboszlai importerz = (DatasetImporterForSzoboszlai) importer;
    assertThat(importerz.getSourceCitation(), containsString("Szoboszlai"));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) DatasetImporterForSzoboszlai(org.eol.globi.data.DatasetImporterForSzoboszlai) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 10 with DatasetRegistryGitHubRemote

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

the class DatasetImporterFactoryImplIT method createWood.

@Test
public void createWood() throws StudyImporterException, DatasetRegistryException, IOException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/wood2015");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForWood.class)));
    DatasetImporterForWood importerz = (DatasetImporterForWood) importer;
    assertThat(importerz.getSourceCitation(), containsString("Wood"));
    assertThat(importerz.getDataset().retrieve(URI.create("links")).toString(), is(notNullValue()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) DatasetImporterForWood(org.eol.globi.data.DatasetImporterForWood) Test(org.junit.Test)

Aggregations

BaseDatasetImporter (org.eol.globi.data.BaseDatasetImporter)12 DatasetImporter (org.eol.globi.data.DatasetImporter)12 DatasetRegistryGitHubRemote (org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote)12 Test (org.junit.Test)12 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 Dataset (org.globalbioticinteractions.dataset.Dataset)2 DatasetRegistry (org.globalbioticinteractions.dataset.DatasetRegistry)2 InputStream (java.io.InputStream)1 DatasetImporterForCoetzer (org.eol.globi.data.DatasetImporterForCoetzer)1 DatasetImporterForGoMexSI2 (org.eol.globi.data.DatasetImporterForGoMexSI2)1 DatasetImporterForHafner (org.eol.globi.data.DatasetImporterForHafner)1 DatasetImporterForMetaTable (org.eol.globi.data.DatasetImporterForMetaTable)1 DatasetImporterForPlanque (org.eol.globi.data.DatasetImporterForPlanque)1 DatasetImporterForSzoboszlai (org.eol.globi.data.DatasetImporterForSzoboszlai)1 DatasetImporterForWood (org.eol.globi.data.DatasetImporterForWood)1 DatasetFactory (org.globalbioticinteractions.dataset.DatasetFactory)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1