From: gmungoc Date: Mon, 13 Oct 2014 08:52:51 +0000 (+0100) Subject: JAL-1264 unit test corrected X-Git-Tag: Jalview_2_9~169^2~22^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e0273ccaa778d70fea45dcca68b31f0cb66310f0;p=jalview.git JAL-1264 unit test corrected --- diff --git a/test/jalview/datamodel/AlignmentTest.java b/test/jalview/datamodel/AlignmentTest.java index 5cc4f83..5920189 100644 --- a/test/jalview/datamodel/AlignmentTest.java +++ b/test/jalview/datamodel/AlignmentTest.java @@ -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 anns = al - .findAnnotation("D.melanogaster.3"); + .findAnnotation("CalcIdForD.melanogaster.2"); Iterator 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()); } }