X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fanalysis%2FAlignmentUtilsTests.java;h=61b24877a71e05ecbd666f3cbdda87ca7f22ce34;hb=fddf3084802b37e5cee17829e32692a4aac3e60d;hp=d32181f15425d64890bb328adedb2258ad91bf6b;hpb=3412b273e964fb1a9d22564b04a5f0c827ec2461;p=jalview.git diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index d32181f..61b2487 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -20,22 +20,12 @@ */ package jalview.analysis; -import static org.testng.AssertJUnit.assertSame; + import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertTrue; import static org.testng.AssertJUnit.assertNull; -import org.testng.annotations.Test; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import static org.testng.AssertJUnit.assertSame; +import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; @@ -53,7 +43,20 @@ import jalview.io.FormatAdapter; import jalview.util.MapList; import jalview.util.MappingUtils; -public class AlignmentUtilsTests +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.testng.annotations.Test; + +public class AlignmentUtilsTests { // @formatter:off private static final String TEST_DATA = @@ -93,7 +96,7 @@ public class AlignmentUtilsTests public static Sequence ts = new Sequence("short", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm"); - @Test + @Test(groups ={ "Functional" }) public void testExpandContext() { AlignmentI al = new Alignment(new Sequence[] {}); @@ -147,7 +150,7 @@ public class AlignmentUtilsTests /** * Test that annotations are correctly adjusted by expandContext */ - @Test + @Test(groups ={ "Functional" }) public void testExpandContext_annotation() { AlignmentI al = new Alignment(new Sequence[] @@ -237,7 +240,7 @@ public class AlignmentUtilsTests * * @throws IOException */ - @Test + @Test(groups ={ "Functional" }) public void testGetSequencesByName() throws IOException { final String data = ">Seq1Name\nKQYL\n" + ">Seq2Name\nRFPW\n" @@ -262,7 +265,7 @@ public class AlignmentUtilsTests */ protected AlignmentI loadAlignment(final String data, String format) throws IOException { - Alignment a = new FormatAdapter().readFile(data, + AlignmentI a = new FormatAdapter().readFile(data, AppletFormatAdapter.PASTE, format); a.setDataset(null); return a; @@ -275,7 +278,7 @@ public class AlignmentUtilsTests * * @throws IOException */ - @Test + @Test(groups ={ "Functional" }) public void testMapProteinToCdna_noXrefs() throws IOException { List protseqs = new ArrayList(); @@ -338,7 +341,7 @@ public class AlignmentUtilsTests /** * Test for the alignSequenceAs method that takes two sequences and a mapping. */ - @Test + @Test(groups ={ "Functional" }) public void testAlignSequenceAs_withMapping_noIntrons() { MapList map = new MapList(new int[] @@ -384,7 +387,7 @@ public class AlignmentUtilsTests /** * Test for the alignSequenceAs method that takes two sequences and a mapping. */ - @Test + @Test(groups ={ "Functional" }) public void testAlignSequenceAs_withMapping_withIntrons() { /* @@ -434,7 +437,7 @@ public class AlignmentUtilsTests /** * Test for the case where not all of the protein sequence is mapped to cDNA. */ - @Test + @Test(groups ={ "Functional" }) public void testAlignSequenceAs_withMapping_withUnmappedProtein() { @@ -484,7 +487,7 @@ public class AlignmentUtilsTests /** * Test for the alignSequenceAs method where we preserve gaps in introns only. */ - @Test + @Test(groups ={ "Functional" }) public void testAlignSequenceAs_keepIntronGapsOnly() { @@ -503,7 +506,7 @@ public class AlignmentUtilsTests * Test for the method that generates an aligned translated sequence from one * mapping. */ - @Test + @Test(groups ={ "Functional" }) public void testGetAlignedTranslation_dnaLikeProtein() { // dna alignment will be replaced @@ -527,7 +530,7 @@ public class AlignmentUtilsTests /** * Test the method that realigns protein to match mapped codon alignment. */ - @Test + @Test(groups ={ "Functional" }) public void testAlignProteinAsDna() { // seq1 codons are [1,2,3] [4,5,6] [7,8,9] [10,11,12] @@ -571,7 +574,7 @@ public class AlignmentUtilsTests * Test the method that tests whether a CDNA sequence translates to a protein * sequence */ - @Test + @Test(groups ={ "Functional" }) public void testTranslatesAs() { assertTrue(AlignmentUtils.translatesAs("tttcccaaaggg".toCharArray(), 0, @@ -610,7 +613,7 @@ public class AlignmentUtilsTests * * @throws IOException */ - @Test + @Test(groups ={ "Functional" }) public void testMapProteinToCdna_withStartAndStopCodons() throws IOException { @@ -703,7 +706,7 @@ public class AlignmentUtilsTests * * @throws IOException */ - @Test + @Test(groups ={ "Functional" }) public void testMapProteinToCdna_withXrefs() throws IOException { List protseqs = new ArrayList(); @@ -779,7 +782,7 @@ public class AlignmentUtilsTests * * @throws IOException */ - @Test + @Test(groups ={ "Functional" }) public void testMapProteinToCdna_prioritiseXrefs() throws IOException { List protseqs = new ArrayList(); @@ -829,7 +832,7 @@ public class AlignmentUtilsTests * Test the method that shows or hides sequence annotations by type(s) and * selection group. */ - @Test + @Test(groups ={ "Functional" }) public void testShowOrHideSequenceAnnotations() { SequenceI seq1 = new Sequence("Seq1", "AAA"); @@ -937,7 +940,7 @@ public class AlignmentUtilsTests /** * Tests for the method that checks if one sequence cross-references another */ - @Test + @Test(groups ={ "Functional" }) public void testHasCrossRef() { assertFalse(AlignmentUtils.hasCrossRef(null, null)); @@ -966,7 +969,7 @@ public class AlignmentUtilsTests * Tests for the method that checks if either sequence cross-references the * other */ - @Test + @Test(groups ={ "Functional" }) public void testHaveCrossRef() { assertFalse(AlignmentUtils.hasCrossRef(null, null)); @@ -996,7 +999,7 @@ public class AlignmentUtilsTests /** * Test the method that extracts the exon-only part of a dna alignment. */ - @Test + @Test(groups ={ "Functional" }) public void testMakeExonAlignment() { SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa"); @@ -1091,7 +1094,7 @@ public class AlignmentUtilsTests * already has a protein product (Uniprot translation) which in turn has an * x-ref to the EMBLCDS record. */ - @Test + @Test(groups ={ "Functional" }) public void testMakeExonSequences() { SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa"); @@ -1133,7 +1136,7 @@ public class AlignmentUtilsTests * its product mappings, for the case where there are multiple exon mappings * to different protein products. */ - @Test + @Test(groups ={ "Functional" }) public void testMakeExonAlignment_multipleProteins() { SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa");