use of org.nextprot.api.core.domain.CvTerm in project nextprot-api by calipho-sib.
the class ConsistencyResourceTest method shouldFindAllTerms.
@Test
public void shouldFindAllTerms() {
boolean missingTerms = false;
List<String> terms = statementDao.findAllDistinctValuesforField(StatementField.ANNOT_CV_TERM_ACCESSION);
System.out.println("Found " + terms.size() + " distinct terms");
for (String t : terms) {
if (t != null) {
CvTerm term = terminologyService.findCvTermByAccession(t);
if (term == null) {
System.err.println("Can t find term " + t);
missingTerms = true;
}
}
}
;
if (missingTerms)
Assert.fail();
}
use of org.nextprot.api.core.domain.CvTerm in project nextprot-api by calipho-sib.
the class TerminologyServiceTest method shouldReturnAUniprotDomain.
@Test
public void shouldReturnAUniprotDomain() {
CvTerm term = this.terminologyService.findCvTermByAccession("DO-00031");
assertEquals("NextprotDomainCv", term.getOntology());
}
use of org.nextprot.api.core.domain.CvTerm in project nextprot-api by calipho-sib.
the class TerminologyServiceTest method shouldReturnTheHierarchy.
@Test
public void shouldReturnTheHierarchy() {
CvTerm term = this.terminologyService.findCvTermByAccession("KW-0906");
// Nuclear pore complex has 3 parents
assertEquals(3, term.getAncestorAccession().size());
}
use of org.nextprot.api.core.domain.CvTerm in project nextprot-api by calipho-sib.
the class TerminologyServiceTest method shouldReturnACellosaurusTerm.
@Test
public void shouldReturnACellosaurusTerm() {
CvTerm term = this.terminologyService.findCvTermByAccession("CVCL_J530");
// System.out.println(term.toString());
assertEquals("NextprotCellosaurusCv", term.getOntology());
assertEquals(2, term.getXrefs().size());
}
use of org.nextprot.api.core.domain.CvTerm in project nextprot-api by calipho-sib.
the class TerminologyServiceTest method shouldReturnAllTerms.
@Test
public void shouldReturnAllTerms() {
int sameascnt = 0, refcnt = 0, maxref = 0;
List<CvTerm> terms = this.terminologyService.findAllCVTerms();
assertTrue(terms.size() > 145000);
for (CvTerm term : terms) {
List<String> sameas = term.getSameAs();
if (sameas != null) {
sameascnt++;
refcnt = sameas.size();
if (refcnt > maxref)
maxref = refcnt;
}
}
assertTrue(sameascnt > 44000);
assertEquals(64, maxref);
}
Aggregations