use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class DatasetImplTest method doiExpectedPrefix.
@Test
public void doiExpectedPrefix() throws IOException {
Dataset dataset = new DatasetImpl("some/namespace", URI.create("some:uri"), inStream -> inStream);
dataset.setConfig(new ObjectMapper().readTree("{\"doi\": \"doi:10.2980/1195-6860(2006)13[23:TDOFUB]2.0.CO;2\" }"));
assertThat(dataset.getDOI(), is(new DOI("2980", "1195-6860(2006)13[23:TDOFUB]2.0.CO;2")));
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class DatasetImplTest method doiExpected.
@Test
public void doiExpected() throws IOException {
Dataset dataset = new DatasetImpl("some/namespace", URI.create("some:uri"), inStream -> inStream);
dataset.setConfig(new ObjectMapper().readTree("{\"doi\": \"http://dx.doi.org/10.2980/1195-6860(2006)13[23:TDOFUB]2.0.CO;2\" }"));
assertThat(dataset.getDOI(), is(new DOI("2980", "1195-6860(2006)13[23:TDOFUB]2.0.CO;2")));
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class DatasetProxyTest method getTestDataset.
public DatasetProxy getTestDataset(JsonNode config, JsonNode configProxy) {
DatasetImpl dataset = new DatasetImpl("some/namespace", URI.create("http://example.com"), inStream -> inStream);
dataset.setConfig(config);
DatasetProxy datasetProxy = new DatasetProxy(dataset);
datasetProxy.setConfig(configProxy);
return datasetProxy;
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class DatasetImporterFactoryImplTest method createImporter.
@Test
public void createImporter() throws StudyImporterException {
DatasetImporter someImporter = new StudyImporterFactoryImpl(null).createImporter(new DatasetImpl("namespace", URI.create("some:uri"), is -> is));
assertThat(someImporter, instanceOf(DatasetImporterForTSV.class));
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class DatasetTest method resourceURL.
@Test
public void resourceURL() throws IOException, URISyntaxException {
URL resource = getClass().getResource("archive.zip");
File archive = new File(resource.toURI());
assertThat(archive.exists(), is(true));
URI parentDir = archive.getParentFile().toURI();
Dataset dataset = new DatasetImpl("some/namespace", parentDir, inStream -> inStream);
InputStream retrieve = dataset.retrieve(resource.toURI());
assertArchiveHash(retrieve);
assertArchiveHash(dataset.retrieve(URI.create("archive.zip")));
assertArchiveHash(dataset.retrieve(URI.create("/archive.zip")));
}
Aggregations