JAL-1270 testIsMappable added
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 17 Aug 2015 15:23:29 +0000 (16:23 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 17 Aug 2015 15:23:29 +0000 (16:23 +0100)
test/jalview/analysis/AlignmentUtilsTests.java

index 61b2487..6fef829 100644 (file)
@@ -1267,4 +1267,22 @@ public class AlignmentUtilsTests
     assertEquals(1, peptideMappings.size());
     assertSame(pep3.getDatasetSequence(), peptideMappings.get(0).getTo());
   }
+
+  @Test(groups = { "Functional" })
+  public void testIsMappable()
+  {
+    SequenceI dna1 = new Sequence("dna1", "cgCAGtgGT");
+    SequenceI aa1 = new Sequence("aa1", "RSG");
+    AlignmentI al1 = new Alignment(new SequenceI[] { dna1 });
+    AlignmentI al2 = new Alignment(new SequenceI[] { aa1 });
+
+    assertFalse(AlignmentUtils.isMappable(null, null));
+    assertFalse(AlignmentUtils.isMappable(al1, null));
+    assertFalse(AlignmentUtils.isMappable(null, al1));
+    assertFalse(AlignmentUtils.isMappable(al1, al1));
+    assertFalse(AlignmentUtils.isMappable(al2, al2));
+
+    assertTrue(AlignmentUtils.isMappable(al1, al2));
+    assertTrue(AlignmentUtils.isMappable(al2, al1));
+  }
 }