package jalview.datamodel;
import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+import jalview.gui.JvOptionPane;
import jalview.util.MapList;
import java.util.Arrays;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/**
*/
public class MappingTest
{
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
/**
* trite test of the intersectVisContigs method for a simple DNA -> Protein
* exon map and a range of visContigs
m = new Mapping(seq, fk);
assertEquals("[ [1, 6] [8, 13] ] 3:1 to [ [4, 7] ] Seq1", m.toString());
}
+
+ @Test(groups = { "Functional" })
+ public void testCopyConstructor()
+ {
+ MapList ml = new MapList(new int[] { 1, 6, 8, 13 }, new int[] { 4, 7 },
+ 3, 1);
+ SequenceI seq = new Sequence("seq1", "agtacg");
+ Mapping m = new Mapping(seq, ml);
+ m.setMappedFromId("abc");
+ Mapping copy = new Mapping(m);
+ assertEquals("abc", copy.getMappedFromId());
+ assertEquals(ml, copy.getMap());
+ assertSame(seq, copy.getTo());
+ }
}