Search in sources :

Example 26 with AnnotationEvidence

use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.

the class AnnotationTest method testNegativeAndPositive.

/*
	 * at least one detected, low, high or medium => detected !
     */
@Test
public void testNegativeAndPositive() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("negative"));
    evidences.add(buildEvidence("positive"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 27 with AnnotationEvidence

use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.

the class AnnotationTest method testOneNotDetected.

@Test
public void testOneNotDetected() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("not detected"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(!a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 28 with AnnotationEvidence

use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.

the class AnnotationTest method testNotDetectedAndPositive.

/*
	 * at least one detected, low, high or medium => detected !
	 */
@Test
public void testNotDetectedAndPositive() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("not detected"));
    evidences.add(buildEvidence("positive"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 29 with AnnotationEvidence

use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.

the class AnnotationTest method testHighAndPositive.

@Test
public void testHighAndPositive() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(buildEvidence("high"));
    evidences.add(buildEvidence("positive"));
    a.setEvidences(evidences);
    Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
    Assert.assertTrue(a.isExpressionLevelDetected().get());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Example 30 with AnnotationEvidence

use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.

the class AnnotationTest method testNoExpressionLevel.

/*
	 * occurs for every annotation not being a :ExpressionProfile
	 */
@Test
public void testNoExpressionLevel() {
    Annotation a = new Annotation();
    List<AnnotationEvidence> evidences = new ArrayList<>();
    evidences.add(new AnnotationEvidence());
    a.setEvidences(evidences);
    Assert.assertTrue(!a.isExpressionLevelDetected().isPresent());
}
Also used : AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) ArrayList(java.util.ArrayList) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Test(org.junit.Test)

Aggregations

AnnotationEvidence (org.nextprot.api.core.domain.annotation.AnnotationEvidence)39 Annotation (org.nextprot.api.core.domain.annotation.Annotation)28 Test (org.junit.Test)23 ArrayList (java.util.ArrayList)16 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)11 AnnotationIsoformSpecificity (org.nextprot.api.core.domain.annotation.AnnotationIsoformSpecificity)7 CvTerm (org.nextprot.api.core.domain.CvTerm)6 AnnotationCategory (org.nextprot.api.commons.constants.AnnotationCategory)5 Collectors (java.util.stream.Collectors)4 BioObject (org.nextprot.api.core.domain.BioObject)4 java.util (java.util)3 List (java.util.List)3 NextProtException (org.nextprot.api.commons.exception.NextProtException)3 DbXref (org.nextprot.api.core.domain.DbXref)3 AnnotationEvidenceProperty (org.nextprot.api.core.domain.annotation.AnnotationEvidenceProperty)3 AnnotationProperty (org.nextprot.api.core.domain.annotation.AnnotationProperty)3 Supplier (com.google.common.base.Supplier)2 Logger (org.apache.log4j.Logger)2 IdentifierOffset (org.nextprot.api.commons.constants.IdentifierOffset)2 StringUtils (org.nextprot.api.commons.utils.StringUtils)2