2121package org .biojava .nbio .core .sequence .location ;
2222
2323import static org .junit .jupiter .api .Assertions .assertEquals ;
24- import static org .junit .jupiter .api .Assertions .assertNotNull ;
2524
26- import java .util .Arrays ;
27- import java .util .Collection ;
25+
2826import org .biojava .nbio .core .sequence .DataSource ;
2927import org .biojava .nbio .core .sequence .location .InsdcParser .complexFeaturesAppendEnum ;
3028import org .biojava .nbio .core .sequence .location .template .Location ;
31- import org .junit .jupiter .api .Test ;
3229import org .junit .jupiter .params .ParameterizedTest ;
3330import org .junit .jupiter .params .provider .CsvSource ;
3431import org .slf4j .Logger ;
@@ -43,7 +40,6 @@ public class InsdcParserTest {
4340
4441 private Logger log = LoggerFactory .getLogger (getClass ());
4542
46-
4743 /**
4844 * Test for issue #254
4945 *
@@ -64,21 +60,15 @@ public void extractAccessionTest(String data, String expected) throws Exception
6460 }
6561 }
6662
67- @ Test
68- public void testParser () {
69- String [] testStrings = { "J00194.1:100..202" , "A00001.5:34..45" , "43..129" , "bond(55,110)" ,
70- "bond(34,35),join(56..80),complement(45,73)" ,
71- "order(complement(30,40),70..80),bond(34,35),join(56,80),complement(45..56)" ,
72- "join(join(complement(30,40),complement(70..80)),bond(34,35),join(56,80),complement(45..56))" ,
73- "complement(join(complement(2000..4000),complement(70..80)),bond(34,35),join(56,80),complement(45..56))" ,
74-
75- };
63+ @ ParameterizedTest
64+ @ CsvSource (delimiterString = "|" , value = { "J00194.1:100..202|100..202(+)" , "A00001.5:34..45|34..45(+)" ,
65+ "43..129|43..129(+)" , "bond(55,110)|55..110(+)" , "bond(34,35),join(56..80),complement(45,73)|34..80(.)" ,
66+ "order(complement(30,40),70..80),bond(34,35),join(56,80),complement(45..56)|30..80(.)" ,
67+ "join(join(complement(30,40),complement(70..80)),bond(34,35),join(56,80),complement(45..56))|30..80(.)" ,
68+ "complement(join(complement(2000..4000),complement(70..80)),bond(34,35),join(56,80),complement(45..56))|34..4000(.)" })
69+ void testParser (String header , String parsedLocation ) {
7670 InsdcParser p = new InsdcParser ();
7771 p .setComplexFeaturesAppendMode (complexFeaturesAppendEnum .HIERARCHICAL );
78-
79- for (String s : testStrings ) {
80- Location l = p .parse (s );
81- assertNotNull (l );
82- }
72+ assertEquals (parsedLocation , p .parse (header ).toString ());
8373 }
8474}
0 commit comments