Search in sources :

Example 46 with DOI

use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.

the class DOIResolverImplIT method resolveDOIByNonExistentCitation.

@Test
public void resolveDOIByNonExistentCitation() throws IOException {
    DOI doi = new DOIResolverImpl().resolveDoiFor("A. Thessen. 2014. Species associations extracted from EOL text data objects via text mining. Accessed at <associations_all_revised.txt> on 05 Feb 2018 and add some more and other things");
    assertThat(doi, is(nullValue()));
}
Also used : DOI(org.globalbioticinteractions.doi.DOI) Test(org.junit.Test)

Example 47 with DOI

use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.

the class DOIResolverImplIT method resolveDOIByReferenceMatch2.

@Test
public void resolveDOIByReferenceMatch2() throws IOException {
    DOI doi = new DOIResolverImpl().resolveDoiFor(MEDAN);
    assertThat(doi.toString(), is(MEDAN_DOI));
}
Also used : DOI(org.globalbioticinteractions.doi.DOI) Test(org.junit.Test)

Example 48 with DOI

use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.

the class DOIResolverImplIT method findCitationForShortDOI.

@Test
public void findCitationForShortDOI() throws IOException, URISyntaxException {
    String citationForDOI = new DOIResolverImpl().findCitationForDOI(new DOI("1007", "s13127-011-0039-1"));
    assertThat(citationForDOI, is(notNullValue()));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) DOI(org.globalbioticinteractions.doi.DOI) Test(org.junit.Test)

Example 49 with DOI

use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.

the class DOIResolverImplIT method resolveWithCrossRefIntermittentRuntimeError.

@Test
public void resolveWithCrossRefIntermittentRuntimeError() throws IOException {
    // see https://github.com/CrossRef/rest-api-doc/issues/93
    String citation = new DOIResolverImpl().findCitationForDOI(new DOI("1017", "s0266467499000760"));
    assertThat(citation, is("Poulin B, Wright SJ, Lefebvre G, Calderón O. Interspecific synchrony and asynchrony in the fruiting phenologies of congeneric bird-dispersed plants in Panama. Journal of Tropical Ecology [Internet]. 1999 March;15(2):213–227. Available from: http://dx.doi.org/10.1017/s0266467499000760"));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) DOI(org.globalbioticinteractions.doi.DOI) Test(org.junit.Test)

Example 50 with DOI

use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.

the class DOIResolverImplIT method findCitationForDOI.

@Test
public void findCitationForDOI() throws IOException {
    String citationForDOI = new DOIResolverImpl().findCitationForDOI(new DOI("1086", "283073"));
    assertThat(citationForDOI, is("Menge BA, Sutherland JP. Species Diversity Gradients: Synthesis of the Roles of Predation, Competition, and Temporal Heterogeneity. The American Naturalist [Internet]. 1976 May;110(973):351–369. Available from: http://dx.doi.org/10.1086/283073"));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) DOI(org.globalbioticinteractions.doi.DOI) Test(org.junit.Test)

Aggregations

DOI (org.globalbioticinteractions.doi.DOI)74 Test (org.junit.Test)50 StudyImpl (org.eol.globi.domain.StudyImpl)28 IOException (java.io.IOException)15 Study (org.eol.globi.domain.Study)15 Specimen (org.eol.globi.domain.Specimen)13 StudyNode (org.eol.globi.domain.StudyNode)12 Matchers.containsString (org.hamcrest.Matchers.containsString)12 TaxonImpl (org.eol.globi.domain.TaxonImpl)11 URI (java.net.URI)10 LabeledCSVParser (com.Ostermiller.util.LabeledCSVParser)8 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)8 DatasetImpl (org.globalbioticinteractions.dataset.DatasetImpl)8 MalformedDOIException (org.globalbioticinteractions.doi.MalformedDOIException)8 Location (org.eol.globi.domain.Location)7 LocationImpl (org.eol.globi.domain.LocationImpl)7 ArrayList (java.util.ArrayList)6 Dataset (org.globalbioticinteractions.dataset.Dataset)6 Reader (java.io.Reader)5 StringReader (java.io.StringReader)5