X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fdatamodel%2FAlignmentAnnotationTests.java;fp=test%2Fjalview%2Fdatamodel%2FAlignmentAnnotationTests.java;h=f23b3d2ea38baf32af977a2aa0f8058ad890423e;hb=b8810711642d8473325c8a3d3e76cc5c3c9b5bbd;hp=7df6255bf59d03a6b4013965a1651e76e098ed3e;hpb=936d4dc095734df2b1e9f3bf9e0bd29b9c86434c;p=jalview.git diff --git a/test/jalview/datamodel/AlignmentAnnotationTests.java b/test/jalview/datamodel/AlignmentAnnotationTests.java index 7df6255..f23b3d2 100644 --- a/test/jalview/datamodel/AlignmentAnnotationTests.java +++ b/test/jalview/datamodel/AlignmentAnnotationTests.java @@ -1,21 +1,26 @@ package jalview.datamodel; -import static org.junit.Assert.*; - -import java.awt.Frame; - -import javax.swing.JFrame; -import javax.swing.SwingWorker; - +import static org.junit.Assert.assertEquals; import jalview.analysis.AlignSeq; -import jalview.gui.AlignFrame; import jalview.io.AppletFormatAdapter; -import jalview.io.FormatAdapter; import org.junit.Test; public class AlignmentAnnotationTests { + @Test + public void testCopyConstructor() + { + SequenceI sq = new Sequence("Foo", "ARAARARARAWEAWEAWRAWEAWE"); + createAnnotation(sq); + AlignmentAnnotation alc, alo = sq.getAnnotation()[0]; + alc = new AlignmentAnnotation(alo); + for (String key : alo.getProperties()) + { + assertEquals("Property mismatch", alo.getProperty(key), + alc.getProperty(key)); + } + } /** * create some dummy annotation derived from the sequence * @@ -27,12 +32,13 @@ public class AlignmentAnnotationTests for (int i = 0; i < al.length; i++) { al[i] = new Annotation(new Annotation("" + sq.getCharAt(i), "", - (char) 0, (float) sq.findPosition(i))); + (char) 0, sq.findPosition(i))); } AlignmentAnnotation alan = new AlignmentAnnotation("For " + sq.getName(), "Fake alignment annot", al); // create a sequence mapping for the annotation vector in its current state alan.createSequenceMapping(sq, sq.getStart(), false); + alan.setProperty("CreatedBy", "createAnnotation"); sq.addAlignmentAnnotation(alan); }