use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class StudyImporterForICES method atePrey.
private Specimen atePrey(Specimen predatorSpecimen, String preyName, Study study) throws NodeFactoryException {
Specimen preySpecimen = nodeFactory.createSpecimen(study, new TaxonImpl(preyName, null));
predatorSpecimen.ate(preySpecimen);
return preySpecimen;
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class TaxonUtilTest method homonymBacteria.
@Test
public void homonymBacteria() {
TaxonImpl taxon = new TaxonImpl();
taxon.setName("Bacteria");
taxon.setExternalId("some:id");
taxon.setPath(" | Eukaryota | Opisthokonta | Metazoa | Eumetazoa | Bilateria | Protostomia | Ecdysozoa | Panarthropoda | Arthropoda | Mandibulata | Pancrustacea | Hexapoda | Insecta | Dicondylia | Pterygota | Neoptera | Orthopteroidea | Phasmatodea | Verophasmatodea | Anareolatae | Diapheromeridae | Diapheromerinae | Diapheromerini | Bacteria");
taxon.setPathNames(" | superkingdom | | kingdom | | | | | | phylum | | | superclass | class | | | subclass | infraclass | order | suborder | infraorder | family | subfamily | tribe | genus");
TaxonImpl otherTaxon = new TaxonImpl();
otherTaxon.setName("Bacteria");
otherTaxon.setExternalId("some:otherid");
otherTaxon.setPath("Bacteria");
otherTaxon.setPathNames("kingdom");
assertThat(TaxonUtil.likelyHomonym(taxon, otherTaxon), is(true));
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class TaxonUtilTest method notHomonymSparseHigherOrderRanks.
@Test
public // see https://github.com/jhpoelen/eol-globi-data/issues/249
void notHomonymSparseHigherOrderRanks() {
TaxonImpl taxon = new TaxonImpl();
taxon.setName("Medicago sativa");
taxon.setPath("Biota | Plantae | Tracheophyta | Magnoliopsida | Fabales | Fabaceae | Medicago | Medicago sativa");
taxon.setPathNames("Unranked|Kingdom|Phylum|Class|Order|Family|Genus|Species");
TaxonImpl otherTaxon = new TaxonImpl();
otherTaxon.setName("Medicago sativa");
otherTaxon.setPath("Eukaryota|Streptophyta|Medicago|Medicago sativa|Papilionoideae|Trifolieae||Fabaceae|Viridiplantae|Fabales");
otherTaxon.setPathNames("superkingdom|phylum|genus|species|subfamily|tribe|subclass|family|kingdom|order");
assertFalse(TaxonUtil.likelyHomonym(taxon, otherTaxon));
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class TaxonUtilTest method notHomonym.
@Test
public void notHomonym() {
TaxonImpl taxon = new TaxonImpl();
taxon.setName("Lestes");
taxon.setPath("Insecta|Lestidae|Lestes");
taxon.setPathNames("class|family|genus");
TaxonImpl otherTaxon = new TaxonImpl();
otherTaxon.setName("Lestes");
otherTaxon.setPath("Insecta|Lestidae|Lestes");
otherTaxon.setPathNames("class|family|genus");
assertThat(TaxonUtil.likelyHomonym(taxon, otherTaxon), is(false));
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class TaxonUtilTest method noHomonymNotEnoughPathInfo.
@Test
public void noHomonymNotEnoughPathInfo() {
TaxonImpl taxon = new TaxonImpl();
taxon.setName("Lestes");
taxon.setPath("x|y|z");
taxon.setPathNames("a|b|c");
TaxonImpl otherTaxon = new TaxonImpl();
otherTaxon.setName("Lestes");
otherTaxon.setPath("Mammalia|Mesonychidae|Lestes");
otherTaxon.setPathNames("class|family|genus");
assertFalse(TaxonUtil.likelyHomonym(taxon, otherTaxon));
}
Aggregations