From: Jim Procter Date: Thu, 16 Jun 2016 12:50:16 +0000 (+0100) Subject: JAL-2110 change test for desired behaviour of getCodonFrame() X-Git-Tag: Release_2_10_0~140^2~5^2~49^2~11 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7370d1738f28c093f2f08db5730193fae6c72939;p=jalview.git JAL-2110 change test for desired behaviour of getCodonFrame() --- diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index 2d1f6ff..afa6edb 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -53,6 +53,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import org.testng.Assert; import org.testng.annotations.Test; public class AlignmentUtilsTests @@ -1028,19 +1029,27 @@ public class AlignmentUtilsTests .contains(cds.getSequenceAt(1).getDatasetSequence())); /* - * Verify mappings from CDS to peptide and cDNA to CDS + * Verify mappings from CDS to peptide, cDNA to CDS, and cDNA to peptide * the mappings are on the shared alignment dataset */ - assertSame(dna.getCodonFrames(), cds.getCodonFrames()); - List cdsMappings = cds.getCodonFrames(); - assertEquals(2, cdsMappings.size()); - + List cdsMappings = cds.getDataset().getCodonFrames(); + /* + * 6 mappings, 2*(DNA->CDS), 2*(DNA->Pep), 2*(CDS->Pep) + */ + assertEquals(6, cdsMappings.size()); + /* + * verify that mapping sets for dna and cds alignments are different + */ + Assert.assertNotSame(dna.getCodonFrames(), cds.getCodonFrames()); + assertEquals(4, dna.getCodonFrames()); + assertEquals(4, cds.getCodonFrames()); /* * Mapping from pep1 to GGGTTT in first new exon sequence */ List pep1Mapping = MappingUtils - .findMappingsForSequence(pep1, cdsMappings); - assertEquals(1, pep1Mapping.size()); + .findMappingsForSequence(pep1, cds.getCodonFrames()); + assertEquals(1, pep1Mapping.size()); // CDS->Pep + // map G to GGG SearchResults sr = MappingUtils .buildSearchResults(pep1, 1, cdsMappings);