--- /dev/null
+package jalview.datamodel;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class SequenceDummyTest
+{
+ /**
+ * test for become method
+ */
+ @Test
+ public void testBecome()
+ {
+ SequenceI seq = new Sequence("OrigSeq", "ASEQUENCE");
+ SequenceFeature ofeat = new SequenceFeature("NewFeat", "somedesc", 3,
+ 12, 2.3f, "none");
+
+ SequenceDummy dummySeq = new SequenceDummy("OrigSeq");
+ dummySeq.addSequenceFeature(ofeat);
+ dummySeq.become(seq);
+ Assert.assertFalse("Dummy sequence did not become a full sequence",
+ dummySeq.isDummy());
+ Assert.assertTrue("Sequence was not updated from template", seq
+ .getSequenceAsString().equals(dummySeq.getSequenceAsString()));
+ boolean found = false;
+ for (SequenceFeature sf : dummySeq.getSequenceFeatures())
+ {
+ if (sf == ofeat)
+ {
+ found = true;
+ break;
+ }
+ }
+ Assert.assertTrue("Didn't retain original sequence feature", found);
+
+ // todo - should test all aspect of copy constructor
+ }
+}