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