1 package jalview.datamodel.xdb.embl;
3 import static org.testng.AssertJUnit.assertEquals;
5 import jalview.datamodel.Sequence;
6 import jalview.datamodel.SequenceI;
8 import java.util.ArrayList;
9 import java.util.Arrays;
10 import java.util.List;
12 import org.testng.annotations.Test;
14 public class EmblEntryTest
16 @Test(groups = "Functional")
17 public void testGetCdsRanges()
19 EmblEntry testee = new EmblEntry();
22 * Make a (CDS) Feature with 4 locations
24 EmblFeature cds = new EmblFeature();
25 cds.setLocation("join(10..20,complement(30..40),50..60,70..80,complement(110..120))");
27 int[] exons = testee.getCdsRanges(cds);
28 assertEquals("[10, 20, 40, 30, 50, 60, 70, 80, 120, 110]",
29 Arrays.toString(exons));
32 @Test(groups = "Functional")
33 public void testParseCodingFeature()
35 // not the whole sequence but enough for this test...
36 SequenceI dna = new Sequence("J03321", "GGATCCGTAAGTTAGACGAAATT");
37 List<SequenceI> peptides = new ArrayList<SequenceI>();
38 EmblFile ef = EmblTestHelper.getEmblFile();
39 EmblFeature feature = null;
40 for (EmblFeature feat : ef.getEntries().get(0).getFeatures())
42 if ("CDS".equals(feat.getName()))
49 EmblEntry testee = new EmblEntry();
50 testee.parseCodingFeature(feature, "EMBL", dna, peptides);