JAL-1264 unit test corrected
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 13 Oct 2014 08:52:51 +0000 (09:52 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 13 Oct 2014 08:52:51 +0000 (09:52 +0100)
test/jalview/datamodel/AlignmentTest.java

index 5cc4f83..5920189 100644 (file)
@@ -3,8 +3,6 @@ package jalview.datamodel;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import jalview.gui.AlignFrame;
-import jalview.gui.AlignmentPanel;
 import jalview.io.AppletFormatAdapter;
 
 import java.io.IOException;
@@ -32,7 +30,8 @@ public class AlignmentTest
           "D.melanogaster.2          C.AUUCAACU.UAUGAGGAU\n" +
           "#=GR D.melanogaster.2 SS  ................((((\n" +
           "D.melanogaster.3          G.UGGCGCU..UAUGACGCA\n" +
-          "#=GR D.melanogaster.3 SS  (.(((...(....(((((((\n";
+          "#=GR D.melanogaster.3 SS  (.(((...(....(((((((\n" +
+          "//";
   // @formatter:on
 
 
@@ -47,8 +46,14 @@ public class AlignmentTest
   {
     al = new jalview.io.FormatAdapter().readFile(TEST_DATA,
             AppletFormatAdapter.PASTE, "STH");
-    AlignFrame af = new AlignFrame(al, 700, 500);
-    new AlignmentPanel(af, af.getViewport());
+    for (int i = 0; i < al.getSequencesArray().length; ++i)
+    {
+      al.getSequenceAt(i).setDatasetSequence(
+              al.getSequenceAt(i).createDatasetSequence());
+      al.addAnnotation(al.getSequenceAt(i).getAnnotation()[0]);
+      al.getSequenceAt(i).getAnnotation()[0].setCalcId("CalcIdFor"
+              + al.getSequenceAt(i).getName());
+    }
   }
 
   /**
@@ -58,11 +63,11 @@ public class AlignmentTest
   public void testFindAnnotation_byCalcId()
   {
     Iterable<AlignmentAnnotation> anns = al
-            .findAnnotation("D.melanogaster.3");
+            .findAnnotation("CalcIdForD.melanogaster.2");
     Iterator<AlignmentAnnotation> iter = anns.iterator();
     assertTrue(iter.hasNext());
     AlignmentAnnotation ann = iter.next();
-    assertEquals("D.melanogaster.3", ann.sequenceRef.getName());
+    assertEquals("D.melanogaster.2", ann.sequenceRef.getName());
     assertFalse(iter.hasNext());
   }
 }