use of org.eol.globi.domain.StudyImpl in project eol-globi-data by jhpoelen.
the class ExporterTaxaDistinctTest method excludeNoMatchNames.
@Test
public void excludeNoMatchNames() throws NodeFactoryException, IOException {
Study study = nodeFactory.createStudy(new StudyImpl("bla", null, null, null));
Specimen predator = nodeFactory.createSpecimen(study, new TaxonImpl(PropertyAndValueDictionary.NO_MATCH, "EOL:1234"));
Specimen prey = nodeFactory.createSpecimen(study, new TaxonImpl(PropertyAndValueDictionary.NO_MATCH, "EOL:122"));
predator.ate(prey);
assertThat(exportStudy(study), not(containsString(PropertyAndValueDictionary.NO_MATCH)));
}
use of org.eol.globi.domain.StudyImpl in project eol-globi-data by jhpoelen.
the class ExporterSiteMapForCitationsTest method writeSiteMapWithCitations.
@Test
public void writeSiteMapWithCitations() throws StudyImporterException, IOException {
final Study study = nodeFactory.getOrCreateStudy(new StudyImpl("title", "source", "doi:some/doi", "citation123&bla"));
assertThat(study.getExternalId(), is("http://dx.doi.org/some/doi"));
final File baseDirCitations = createBaseDir("target/sitemap/citations");
final GraphExporter siteMapForCitationsExporter = new ExporterSiteMapForCitations();
siteMapForCitationsExporter.export(getGraphDb(), baseDirCitations.getAbsolutePath());
final String substring = "http://www.globalbioticinteractions.org/?accordingTo=" + "http://dx.doi.org/some/doi";
assertSiteMap(baseDirCitations, substring, "https://depot.globalbioticinteractions.org/snapshot/target/data/sitemap/citations/sitemap.xml.gz");
}
use of org.eol.globi.domain.StudyImpl in project eol-globi-data by jhpoelen.
the class ExporterReferencesTest method exportReference.
@Test
public void exportReference() throws IOException, NodeFactoryException, ParseException {
StudyImpl myStudy1 = new StudyImpl("myStudy", "a source", "doi:1234", ExternalIdUtil.toCitation("John Doe", "description study 1", "1927"));
myStudy1.setExternalId("GAME:444");
Study myStudy = nodeFactory.getOrCreateStudy(myStudy1);
StringWriter row = new StringWriter();
new ExporterReferences().exportStudy(myStudy, row, true);
assertThat(row.getBuffer().toString(), equalTo(getExpectedData()));
row = new StringWriter();
new ExporterReferences().exportStudy(myStudy, row, false);
assertThat(row.getBuffer().toString(), equalTo(getExpectedRow()));
}
use of org.eol.globi.domain.StudyImpl in project eol-globi-data by jhpoelen.
the class ExporterReferencesTest method exportReferenceNoDescription.
@Test
public void exportReferenceNoDescription() throws IOException, NodeFactoryException, ParseException {
Study myStudy = nodeFactory.createStudy(new StudyImpl("myStudy", null, null, null));
StringWriter row = new StringWriter();
new ExporterReferences().exportStudy(myStudy, row, false);
assertThat(row.getBuffer().toString(), equalTo("\nglobi:ref:1\t\tmyStudy\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"));
}
use of org.eol.globi.domain.StudyImpl in project eol-globi-data by jhpoelen.
the class ExporterReferencesTest method exportReferenceEscapeCharacters.
@Test
public void exportReferenceEscapeCharacters() throws IOException, NodeFactoryException, ParseException {
Study myStudy = nodeFactory.createStudy(new StudyImpl("myStudy", null, "doi:some/doi", "bla \"one\""));
StringWriter row = new StringWriter();
new ExporterReferences().exportStudy(myStudy, row, false);
assertThat(row.getBuffer().toString(), equalTo("\nglobi:ref:1\t\tbla \"one\"\t\t\t\t\t\t\t\t\t\t\t\t\thttp://dx.doi.org/some/doi\tdoi:some/doi\t"));
}
Aggregations