JAL-2114 save 'raw' ENA location as a sequence feature attribute
[jalview.git] / test / jalview / datamodel / xdb / embl / EmblEntryTest.java
index cab3b92..c36b7d3 100644 (file)
@@ -2,7 +2,12 @@ package jalview.datamodel.xdb.embl;
 
 import static org.testng.AssertJUnit.assertEquals;
 
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
 import org.testng.annotations.Test;
 
@@ -23,4 +28,25 @@ public class EmblEntryTest
     assertEquals("[10, 20, 40, 30, 50, 60, 70, 80, 120, 110]",
             Arrays.toString(exons));
   }
+
+  @Test(groups = "Functional")
+  public void testParseCodingFeature()
+  {
+    // not the whole sequence but enough for this test...
+    SequenceI dna = new Sequence("J03321", "GGATCCGTAAGTTAGACGAAATT");
+    List<SequenceI> peptides = new ArrayList<SequenceI>();
+    EmblFile ef = EmblTestHelper.getEmblFile();
+    EmblFeature feature = null;
+    for (EmblFeature feat : ef.getEntries().get(0).getFeatures())
+    {
+      if ("CDS".equals(feat.getName()))
+      {
+        feature = feat;
+        break;
+      }
+    }
+
+    EmblEntry testee = new EmblEntry();
+    testee.parseCodingFeature(feature, "EMBL", dna, peptides);
+  }
 }