X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fanalysis%2FDnaTest.java;h=2e21d9c0e2c2c4daee93ad176325b6a74d15b39a;hb=fe28b89504fd1b76cc9d9631184aa6e065d7e243;hp=78277abd91619134a4d38edfda49a90756f48fcd;hpb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;p=jalview.git diff --git a/test/jalview/analysis/DnaTest.java b/test/jalview/analysis/DnaTest.java index 78277ab..2e21d9c 100644 --- a/test/jalview/analysis/DnaTest.java +++ b/test/jalview/analysis/DnaTest.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -32,14 +32,25 @@ import jalview.datamodel.ColumnSelection; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignViewport; +import jalview.gui.JvOptionPane; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; import jalview.io.FormatAdapter; import java.io.IOException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class DnaTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // @formatter:off // AA encoding codons as ordered on the Jalview help page Amino Acid Table private static String fasta = ">B\n" + "GCT" + "GCC" + "GCA" + "GCG" @@ -120,8 +131,8 @@ public class DnaTest throws IOException { AlignmentI alf = new FormatAdapter().readFile( - JAL_1312_example_align_fasta, jalview.io.FormatAdapter.PASTE, - "FASTA"); + JAL_1312_example_align_fasta, DataSourceType.PASTE, + FileFormat.Fasta); ColumnSelection cs = new ColumnSelection(); AlignViewportI av = new AlignViewport(alf, cs); Dna dna = new Dna(av, new int[] { 0, alf.getWidth() - 1 }); @@ -141,8 +152,8 @@ public class DnaTest throws IOException { AlignmentI alf = new FormatAdapter().readFile( - JAL_1312_example_align_fasta, jalview.io.FormatAdapter.PASTE, - "FASTA"); + JAL_1312_example_align_fasta, DataSourceType.PASTE, + FileFormat.Fasta); int vwidth = 15; for (int ipos = 0; ipos + vwidth < alf.getWidth(); ipos += vwidth) { @@ -176,7 +187,7 @@ public class DnaTest public void testTranslateCdna_simple() throws IOException { AlignmentI alf = new FormatAdapter().readFile(fasta, - FormatAdapter.PASTE, "FASTA"); + DataSourceType.PASTE, FileFormat.Fasta); ColumnSelection cs = new ColumnSelection(); AlignViewportI av = new AlignViewport(alf, cs); Dna dna = new Dna(av, new int[] { 0, alf.getWidth() - 1 }); @@ -196,8 +207,8 @@ public class DnaTest public void testTranslateCdna_hiddenColumns() throws IOException { AlignmentI alf = new FormatAdapter().readFile(fasta, - FormatAdapter.PASTE, "FASTA"); - ColumnSelection cs = new jalview.datamodel.ColumnSelection(); + DataSourceType.PASTE, FileFormat.Fasta); + ColumnSelection cs = new ColumnSelection(); cs.hideColumns(6, 14); // hide codons 3/4/5 cs.hideColumns(24, 35); // hide codons 9-12 cs.hideColumns(177, 191); // hide codons 60-64 @@ -283,7 +294,8 @@ public class DnaTest /* * Generate cDNA - 8 sequences of 12 bases each. */ - AlignmentI cdna = new DnaAlignmentGenerator().generate(12, 8, 97, 5, 5); + AlignmentI cdna = new AlignmentGenerator(true) + .generate(12, 8, 97, 5, 5); ColumnSelection cs = new ColumnSelection(); AlignViewportI av = new AlignViewport(cdna, cs); Dna dna = new Dna(av, new int[] { 0, cdna.getWidth() - 1 });