X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fschemes%2FDnaCodonTests.java;h=908d07b9f4d0f59d021e316d610118ad390f8e9c;hb=e42eed3a0089a8a064560df4cf17a5021fd1e16a;hp=42f17fd5d730baf3248e7b006a9344db744bc766;hpb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;p=jalview.git diff --git a/test/jalview/schemes/DnaCodonTests.java b/test/jalview/schemes/DnaCodonTests.java index 42f17fd..908d07b 100644 --- a/test/jalview/schemes/DnaCodonTests.java +++ b/test/jalview/schemes/DnaCodonTests.java @@ -20,22 +20,32 @@ */ package jalview.schemes; -import static org.junit.Assert.assertTrue; +import static org.testng.AssertJUnit.assertTrue; + +import jalview.gui.JvOptionPane; import java.util.Map; -import org.junit.Test; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; public class DnaCodonTests { - @Test + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + @Test(groups = { "Functional" }) public void testAmbiguityCodeGeneration() { assertTrue(ResidueProperties.ambiguityCodes.size() > 0); } - @Test + @Test(groups = { "Functional" }) public void testAmbiguityCodon() { for (String ac : ResidueProperties.ambiguityCodes.keySet()) @@ -45,7 +55,7 @@ public class DnaCodonTests } } - @Test + @Test(groups = { "Functional" }) public void regenerateCodonTable() { for (Map.Entry codon : ResidueProperties.codonHash2 @@ -55,43 +65,4 @@ public class DnaCodonTests + codon.getKey() + "\", \"" + codon.getValue() + "\");"); } } - - @Test - public void checkOldCodonagainstNewCodonTable() - { - // note - this test will be removed once the old codon table (including - // Vectors) is removed - String additional = "", failtrans = "", differentTr = ""; - for (String amacid : ResidueProperties.codonHash.keySet()) - { - for (String codon : ResidueProperties.codonHash.get(amacid)) - { - String trans = ResidueProperties.codonTranslate(codon); - String oldtrans = ResidueProperties._codonTranslate(codon); - if (trans == null) - { - additional += "\nOld translation table includes additional codons for " - + amacid + " : " + codon; - } - if (oldtrans == null) - { - failtrans += ("\nold translation routine failed for old translation entry (aa was " - + amacid + " codon was " + codon + ")"); - } - if (!oldtrans.equals(trans)) - { - differentTr += ("\nDifferent translation for old and new routines: " - + amacid - + " " - + codon - + " => expected " - + oldtrans - + " and got " + trans); - } - } - } - assertTrue("" + additional + "\n" + failtrans + "\n" + differentTr, - additional.length() == 0 && failtrans.length() == 0 - && differentTr.length() == 0); - } }