X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FJalviewExportPropertiesTests.java;h=29af91520ef43499780848c387d94d5e1ea9adca;hb=cd669a0e8c7b91b379bca8fe6e702cf0fcbd1ce0;hp=b13f9d19cd680b1c78745230fa5d9bda7eda9548;hpb=ee198b3ca3687f18a2ee186f4e7c7330f4ea30f0;p=jalview.git diff --git a/test/jalview/io/JalviewExportPropertiesTests.java b/test/jalview/io/JalviewExportPropertiesTests.java index b13f9d1..29af915 100644 --- a/test/jalview/io/JalviewExportPropertiesTests.java +++ b/test/jalview/io/JalviewExportPropertiesTests.java @@ -22,13 +22,15 @@ package jalview.io; import static org.testng.AssertJUnit.assertTrue; -import jalview.datamodel.SequenceGroup; -import jalview.gui.AlignFrame; - import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import jalview.datamodel.SequenceGroup; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.JvOptionPane; + /** * tests which verify that properties and preferences are correctly interpreted * when exporting/importing data @@ -39,14 +41,22 @@ import org.testng.annotations.Test; public class JalviewExportPropertiesTests { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * @throws java.lang.Exception */ @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { - jalview.bin.Jalview.main(new String[] { "-props", - "test/jalview/io/testProps.jvprops" }); + jalview.bin.Jalview + .main(new String[] + { "--props", "test/jalview/io/testProps.jvprops" }); } /** @@ -55,7 +65,8 @@ public class JalviewExportPropertiesTests @AfterClass(alwaysRun = true) public static void tearDownAfterClass() throws Exception { - jalview.gui.Desktop.instance.closeAll_actionPerformed(null); + if (Desktop.instance != null) + Desktop.instance.closeAll_actionPerformed(null); } @@ -77,8 +88,8 @@ public class JalviewExportPropertiesTests sg.setStartRes(1); sg.setEndRes(7); af.getViewport().setSelectionGroup(sg); - String fseqs = new FormatAdapter(af.alignPanel).formatSequences( - FileFormat.Fasta, af.alignPanel, true); + String fseqs = new FormatAdapter(af.alignPanel) + .formatSequences(FileFormat.Fasta, af.alignPanel, true); assertTrue("Couldn't find '.' in the exported region\n" + fseqs, fseqs.indexOf(".") > -1); }