From e0273ccaa778d70fea45dcca68b31f0cb66310f0 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 13 Oct 2014 09:52:51 +0100 Subject: [PATCH] JAL-1264 unit test corrected --- test/jalview/datamodel/AlignmentTest.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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()); } } -- 1.7.10.2