2424
2525import org .biojava .nbio .ontology .io .OboParser ;
2626import org .biojava .nbio .ontology .utils .Annotation ;
27- import org .junit .Before ;
2827import org .junit .Test ;
2928
3029import java .io .*;
@@ -42,13 +41,16 @@ public class TestParseOBO {
4241
4342 private OboParser parser ;
4443
45- final String testTermEntry = "\n [Term]\n " + "id: SO:0000691\n " + "name: cleaved_initiator_methionine \n "
46- + "namespace: sequence\n " + "alt_id: BS:00067\n "
44+ final String testTermEntry = "\n [Term]\n "
45+ + "id: SO:0000691\n "
46+ + "name: cleaved_initiator_methionine \n "
47+ + "namespace: sequence\n "
48+ + "alt_id: BS:00067\n "
4749 + "def: \" The initiator methionine that has been cleaved from a mature polypeptide sequence.\" [EBIBS:GAR]\n "
48- + "subset: biosapiens\n " + "synonym: \" cleaved initiator methionine\" EXACT []\n "
50+ + "subset: biosapiens\n "
51+ + "synonym: \" cleaved initiator methionine\" EXACT []\n "
4952 + "synonym: \" init_met\" RELATED [uniprot:feature_type]\n "
5053 + "synonym: \" initiator methionine\" RELATED []\n " + "is_a: SO:0100011 ! cleaved_peptide_region\n \n " ;
51- private String replace ;
5254
5355 public Ontology readObo (String input ) throws ParseException , IOException {
5456 parser = new OboParser ();
@@ -62,20 +64,19 @@ public Ontology readObo(String input) throws ParseException, IOException {
6264 @ Test
6365 public void testNamespace () throws IOException , ParseException {
6466 Ontology ontology = readObo (testTermEntry );
65-
6667 Set <Term > keys = ontology .getTerms ();
67-
6868 assertTrue (keys .size () > 1 );
6969 assertTrue (getAnnotationForTerm (ontology ).containsProperty (NAMESPACE ));
7070 assertEquals ("sequence" , getAnnotationForTerm (ontology ).getProperty (NAMESPACE ));
71+ //#964
7172 assertTrue (getAnnotationForTerm (ontology ).getProperty (ALT_ID ) instanceof List );
7273 }
7374
7475 @ Test
7576 public void testMultipleAltIds () throws IOException , ParseException {
7677
77- String replace = testTermEntry .replace ("BS:00067" , "BS:00067\n alt_id: BS:00068" );
78- Ontology ontology = readObo (replace );
78+ String oboWith2AltIds = testTermEntry .replace ("BS:00067" , "BS:00067\n alt_id: BS:00068" );
79+ Ontology ontology = readObo (oboWith2AltIds );
7980 List <String > altIds = (List <String >) getAnnotationForTerm (ontology ).getProperty (ALT_ID );
8081 assertEquals (2 , altIds .size ());
8182 assertEquals ("BS:00067" , altIds .get (0 ));
0 commit comments