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
*
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);
}