1 package jalview.datamodel;
3 import static org.testng.AssertJUnit.assertEquals;
5 import jalview.util.MapList;
7 import java.util.Arrays;
9 import org.testng.annotations.Test;
12 * Test class refactored from main method
14 public class MappingTest
17 * trite test of the intersectVisContigs method for a simple DNA -> Protein
18 * exon map and a range of visContigs
20 @Test(groups = { "Functional" })
21 public void testIntersectVisContigs()
23 MapList fk = new MapList(new int[] { 1, 6, 8, 13, 15, 23 }, new int[] {
25 Mapping m = new Mapping(fk);
26 Mapping m_1 = m.intersectVisContigs(new int[] { fk.getFromLowest(),
27 fk.getFromHighest() });
28 Mapping m_2 = m.intersectVisContigs(new int[] { 1, 7, 11, 20 });
30 // assertions from output values 'as is', not checked for correctness
31 String result = Arrays.deepToString(m_1.map.getFromRanges().toArray());
32 System.out.println(result);
33 assertEquals("[[1, 6], [8, 13], [15, 23]]", result);
35 result = Arrays.deepToString(m_2.map.getFromRanges().toArray());
36 System.out.println(result);
37 assertEquals("[[1, 6], [11, 13], [15, 20]]", result);