Search in sources :

Example 1 with BaseDatasetImporter

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

the class DatasetImporterFactoryImplIT method createHurlbert.

@Test
public void createHurlbert() throws StudyImporterException, DatasetRegistryException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "hurlbertlab/dietdatabase");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForHurlbert.class)));
    final JsonNode config = ((BaseDatasetImporter) importer).getDataset().getConfig();
    assertThat(config, is(notNullValue()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) JsonNode(com.fasterxml.jackson.databind.JsonNode) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 2 with BaseDatasetImporter

use of org.eol.globi.data.BaseDatasetImporter 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)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)2 BaseDatasetImporter (org.eol.globi.data.BaseDatasetImporter)2 DatasetImporter (org.eol.globi.data.DatasetImporter)2 DatasetRegistryGitHubRemote (org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote)2 Test (org.junit.Test)2 Dataset (org.globalbioticinteractions.dataset.Dataset)1