From 5f4e1e4c330b045e9c8bce28ee132a0fca3834d8 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 24 Nov 2016 17:35:50 +0000 Subject: [PATCH 1/1] JAL-2326 added setup method for JvOptionPane in all Jalveiw test classes to enable JvOptionPane to run non-interactively --- test/MCview/AtomTest.java | 10 ++++++++++ test/MCview/BondTest.java | 10 ++++++++++ test/MCview/PDBChainTest.java | 10 ++++++++++ test/MCview/PDBfileTest.java | 10 ++++++++++ test/MCview/ResidueTest.java | 10 ++++++++++ test/jalview/analysis/AAFrequencyTest.java | 10 ++++++++++ test/jalview/analysis/AlignSeqTest.java | 11 +++++++++++ test/jalview/analysis/AlignmentAnnotationUtilsTest.java | 10 ++++++++++ test/jalview/analysis/AlignmentUtilsTests.java | 10 ++++++++++ test/jalview/analysis/AnnotationSorterTest.java | 10 ++++++++++ test/jalview/analysis/CodingUtilsTest.java | 10 ++++++++++ test/jalview/analysis/ConservationTest.java | 10 ++++++++++ test/jalview/analysis/CrossRefTest.java | 10 ++++++++++ test/jalview/analysis/DnaAlignmentGenerator.java | 12 ++++++++++++ test/jalview/analysis/DnaTest.java | 9 +++++++++ test/jalview/analysis/FinderTest.java | 8 ++++++++ test/jalview/analysis/GroupingTest.java | 9 +++++++++ test/jalview/analysis/ParsePropertiesTest.java | 9 +++++++++ test/jalview/analysis/RnaTest.java | 10 ++++++++++ test/jalview/analysis/SeqsetUtilsTest.java | 11 +++++++++++ test/jalview/analysis/SequenceIdMatcherTest.java | 10 ++++++++++ test/jalview/analysis/TestAlignSeq.java | 9 +++++++++ .../analysis/scoremodels/FeatureScoreModelTest.java | 10 ++++++++++ test/jalview/bin/ArgsParserTest.java | 11 +++++++++++ test/jalview/bin/CacheTest.java | 10 ++++++++++ test/jalview/bin/CommandLineOperations.java | 11 +++++++++++ test/jalview/bin/JalviewLiteTest.java | 10 ++++++++++ test/jalview/commands/EditCommandTest.java | 9 +++++++++ test/jalview/commands/TrimRegionCommandTest.java | 10 ++++++++++ test/jalview/controller/AlignViewControllerTest.java | 10 ++++++++++ test/jalview/datamodel/AlignedCodonFrameTest.java | 9 +++++++++ test/jalview/datamodel/AlignedCodonIteratorTest.java | 10 ++++++++++ test/jalview/datamodel/AlignedCodonTest.java | 10 ++++++++++ test/jalview/datamodel/AlignmentAnnotationTests.java | 10 ++++++++++ test/jalview/datamodel/AlignmentTest.java | 10 ++++++++++ test/jalview/datamodel/AlignmentViewTest.java | 11 +++++++++++ test/jalview/datamodel/ColumnSelectionTest.java | 10 ++++++++++ test/jalview/datamodel/DBRefEntryTest.java | 9 +++++++++ test/jalview/datamodel/HiddenSequencesTest.java | 10 ++++++++++ test/jalview/datamodel/MappingTest.java | 10 ++++++++++ test/jalview/datamodel/MappingTypeTest.java | 10 +++++++++- test/jalview/datamodel/MatchTest.java | 10 ++++++++++ test/jalview/datamodel/PDBEntryTest.java | 9 +++++++++ test/jalview/datamodel/ResidueCountTest.java | 10 ++++++++++ test/jalview/datamodel/SearchResultsTest.java | 10 ++++++++++ test/jalview/datamodel/SeqCigarTest.java | 10 ++++++++++ test/jalview/datamodel/SequenceDummyTest.java | 11 +++++++++++ test/jalview/datamodel/SequenceFeatureTest.java | 11 +++++++++++ test/jalview/datamodel/SequenceTest.java | 10 ++++++++++ test/jalview/datamodel/xdb/embl/EmblEntryTest.java | 10 ++++++++++ test/jalview/datamodel/xdb/embl/EmblFileTest.java | 9 +++++++++ test/jalview/ext/android/SparseIntArrayTest.java | 11 +++++++++++ test/jalview/ext/android/SparseShortArrayTest.java | 11 +++++++++++ test/jalview/ext/ensembl/EnsemblCdnaTest.java | 9 +++++++++ test/jalview/ext/ensembl/EnsemblCdsTest.java | 9 +++++++++ test/jalview/ext/ensembl/EnsemblGeneTest.java | 9 +++++++++ test/jalview/ext/ensembl/EnsemblGenomeTest.java | 9 +++++++++ test/jalview/ext/ensembl/EnsemblProteinTest.java | 10 ++++++++++ test/jalview/ext/ensembl/EnsemblSeqProxyTest.java | 9 +++++++++ test/jalview/ext/ensembl/EnsemblXrefTest.java | 10 ++++++++++ test/jalview/ext/htsjdk/TestHtsContigDb.java | 10 ++++++++++ test/jalview/ext/jmol/JmolCommandsTest.java | 9 +++++++++ test/jalview/ext/jmol/JmolParserTest.java | 10 ++++++++++ test/jalview/ext/jmol/JmolViewerTest.java | 8 ++++++++ .../ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java | 10 ++++++++++ test/jalview/ext/paradise/TestAnnotate3D.java | 9 +++++++++ test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java | 11 +++++++++++ test/jalview/ext/rbvi/chimera/ChimeraConnect.java | 10 ++++++++++ test/jalview/ext/rbvi/chimera/JalviewChimeraView.java | 8 ++++++++ test/jalview/ext/so/SequenceOntologyTest.java | 9 +++++++++ test/jalview/fts/core/FTSRestClientTest.java | 10 ++++++++++ test/jalview/fts/service/pdb/PDBFTSPanelTest.java | 10 ++++++++++ test/jalview/fts/service/pdb/PDBFTSRestClientTest.java | 9 +++++++++ test/jalview/gui/AlignFrameTest.java | 8 ++++++++ test/jalview/gui/AlignViewportTest.java | 7 +++++++ test/jalview/gui/AnnotationChooserTest.java | 9 +++++++++ test/jalview/gui/AppVarnaTest.java | 9 +++++++++ test/jalview/gui/FontChooserTest.java | 8 ++++++++ test/jalview/gui/HelpTest.java | 9 +++++++++ test/jalview/gui/JAL1353bugdemo.java | 7 +++++++ test/jalview/gui/JvOptionPaneTest.java | 15 ++++++++------- test/jalview/gui/JvSwingUtilsTest.java | 8 ++++++++ test/jalview/gui/PaintRefresherTest.java | 9 +++++++++ test/jalview/gui/PopupMenuTest.java | 9 +++++++++ test/jalview/gui/ProgressBarTest.java | 8 ++++++++ test/jalview/gui/SequenceRendererTest.java | 8 ++++++++ test/jalview/gui/StructureChooserTest.java | 9 +++++++++ test/jalview/gui/StructureViewerTest.java | 9 +++++++++ test/jalview/io/AnnotatedPDBFileInputTest.java | 8 ++++++++ test/jalview/io/AnnotationFileIOTest.java | 9 +++++++++ test/jalview/io/BioJsHTMLOutputTest.java | 9 +++++++++ test/jalview/io/CrossRef2xmlTests.java | 10 ++++++++++ test/jalview/io/FeaturesFileTest.java | 9 +++++++++ test/jalview/io/FileIOTester.java | 9 +++++++++ test/jalview/io/FormatAdapterTest.java | 9 +++++++++ test/jalview/io/HtmlFileTest.java | 10 ++++++++++ test/jalview/io/IdentifyFileTest.java | 10 ++++++++++ test/jalview/io/JSONFileTest.java | 9 +++++++++ test/jalview/io/Jalview2xmlBase.java | 8 ++++++++ test/jalview/io/Jalview2xmlTests.java | 9 +++++++++ test/jalview/io/JalviewExportPropertiesTests.java | 8 ++++++++ test/jalview/io/NewickFileTests.java | 8 ++++++++ test/jalview/io/PfamFormatInputTest.java | 10 ++++++++++ test/jalview/io/PhylipFileTests.java | 9 +++++++++ test/jalview/io/RNAMLfileTest.java | 9 +++++++++ test/jalview/io/SequenceAnnotationReportTest.java | 10 ++++++++++ test/jalview/io/StockholmFileTest.java | 9 +++++++++ test/jalview/io/TCoffeeScoreFileTest.java | 9 +++++++++ test/jalview/io/gff/ExonerateHelperTest.java | 10 ++++++++++ test/jalview/io/gff/Gff3HelperTest.java | 9 +++++++++ test/jalview/io/gff/GffHelperBaseTest.java | 10 ++++++++++ test/jalview/io/gff/GffHelperFactoryTest.java | 10 ++++++++++ test/jalview/io/gff/GffTests.java | 10 ++++++++++ test/jalview/io/gff/InterProScanHelperTest.java | 9 +++++++++ test/jalview/schemes/DnaCodonTests.java | 10 ++++++++++ test/jalview/schemes/FeatureColourTest.java | 10 ++++++++++ test/jalview/schemes/ResidueColourSchemeTest.java | 10 ++++++++++ test/jalview/schemes/ResiduePropertiesTest.java | 10 ++++++++++ test/jalview/schemes/ScoreMatrixPrinter.java | 10 ++++++++++ test/jalview/schemes/UserColourSchemeTest.java | 10 ++++++++++ test/jalview/structure/Mapping.java | 9 +++++++++ .../structure/StructureSelectionManagerTest.java | 10 ++++++++++ .../structures/models/AAStructureBindingModelTest.java | 10 ++++++++++ test/jalview/util/ArrayUtilsTest.java | 11 +++++++++++ test/jalview/util/CaseInsensitiveStringTest.java | 11 +++++++++++ test/jalview/util/ColorUtilsTest.java | 10 ++++++++++ test/jalview/util/ComparisonTest.java | 9 +++++++++ test/jalview/util/DBRefUtilsTest.java | 9 +++++++++ test/jalview/util/DnaUtilsTest.java | 11 +++++++++++ test/jalview/util/FormatTest.java | 11 +++++++++++ test/jalview/util/MapListTest.java | 10 ++++++++++ test/jalview/util/MappingUtilsTest.java | 10 ++++++++++ test/jalview/util/ParseHtmlBodyAndLinksTest.java | 11 +++++++++++ test/jalview/util/PlatformTest.java | 11 +++++++++++ test/jalview/util/QuickSortTest.java | 11 +++++++++++ test/jalview/util/ShiftListTest.java | 10 ++++++++++ test/jalview/util/SparseCountTest.java | 11 +++++++++++ test/jalview/util/StringUtilsTest.java | 10 ++++++++++ test/jalview/util/UrlLinkTest.java | 9 +++++++++ test/jalview/viewmodel/styles/ViewStyleTest.java | 10 ++++++++++ test/jalview/workers/AlignCalcManagerTest.java | 10 ++++++++++ test/jalview/ws/PDBSequenceFetcherTest.java | 9 +++++++++ test/jalview/ws/SequenceFetcherTest.java | 10 ++++++++++ test/jalview/ws/dbsources/UniprotTest.java | 10 ++++++++++ test/jalview/ws/dbsources/XfamFetcherTest.java | 10 ++++++++++ test/jalview/ws/ebi/EBIFetchClientTest.java | 11 +++++++++++ test/jalview/ws/gui/Jws2ParamView.java | 9 +++++++++ test/jalview/ws/jabaws/DisorderAnnotExportImport.java | 9 +++++++++ test/jalview/ws/jabaws/JalviewJabawsTestUtils.java | 8 ++++++++ test/jalview/ws/jabaws/JpredJabaStructExportImport.java | 9 +++++++++ test/jalview/ws/jabaws/MinJabawsClientTests.java | 10 ++++++++++ test/jalview/ws/jabaws/RNAStructExportImport.java | 9 +++++++++ test/jalview/ws/jws2/ParameterUtilsTest.java | 9 +++++++++ test/jalview/ws/rest/RestClientTest.java | 10 ++++++++++ test/jalview/ws/rest/ShmmrRSBSService.java | 9 +++++++++ test/jalview/ws/seqfetcher/DasSequenceFetcher.java | 10 ++++++++++ test/jalview/ws/seqfetcher/DbRefFetcherTest.java | 8 ++++++++ test/jalview/ws/sifts/SiftsClientTest.java | 9 +++++++++ 158 files changed, 1514 insertions(+), 8 deletions(-) diff --git a/test/MCview/AtomTest.java b/test/MCview/AtomTest.java index 21a79fe..2d11fb5 100644 --- a/test/MCview/AtomTest.java +++ b/test/MCview/AtomTest.java @@ -22,12 +22,22 @@ package MCview; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AtomTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test the constructor that parses a PDB file format ATOM line. Fields are in * fixed column positions diff --git a/test/MCview/BondTest.java b/test/MCview/BondTest.java index 28b995c..aa29ad0 100644 --- a/test/MCview/BondTest.java +++ b/test/MCview/BondTest.java @@ -22,11 +22,21 @@ package MCview; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class BondTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testTranslate() { diff --git a/test/MCview/PDBChainTest.java b/test/MCview/PDBChainTest.java index 0406128..7132939 100644 --- a/test/MCview/PDBChainTest.java +++ b/test/MCview/PDBChainTest.java @@ -30,6 +30,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.schemes.ColourSchemeI; import jalview.schemes.TaylorColourScheme; import jalview.structure.StructureImportSettings; @@ -37,11 +38,20 @@ import jalview.structure.StructureImportSettings; import java.awt.Color; import java.util.Vector; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PDBChainTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + PDBChain c; final Atom a1 = new Atom(1f, 2f, 3f); diff --git a/test/MCview/PDBfileTest.java b/test/MCview/PDBfileTest.java index 2863643..551e805 100644 --- a/test/MCview/PDBfileTest.java +++ b/test/MCview/PDBfileTest.java @@ -33,17 +33,27 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.PDBEntry; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.structure.StructureImportSettings; import java.io.IOException; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PDBfileTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testIsRna() { diff --git a/test/MCview/ResidueTest.java b/test/MCview/ResidueTest.java index 5733068..0acd681 100644 --- a/test/MCview/ResidueTest.java +++ b/test/MCview/ResidueTest.java @@ -23,13 +23,23 @@ package MCview; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; +import jalview.gui.JvOptionPane; + import java.util.Vector; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ResidueTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testFindAtom() { diff --git a/test/jalview/analysis/AAFrequencyTest.java b/test/jalview/analysis/AAFrequencyTest.java index 58601a9..75fb39e 100644 --- a/test/jalview/analysis/AAFrequencyTest.java +++ b/test/jalview/analysis/AAFrequencyTest.java @@ -29,11 +29,21 @@ import jalview.datamodel.ProfileI; import jalview.datamodel.ProfilesI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AAFrequencyTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testCalculate_noProfile() { diff --git a/test/jalview/analysis/AlignSeqTest.java b/test/jalview/analysis/AlignSeqTest.java index 53f64e3..4cb5329 100644 --- a/test/jalview/analysis/AlignSeqTest.java +++ b/test/jalview/analysis/AlignSeqTest.java @@ -23,10 +23,21 @@ package jalview.analysis; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignSeqTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testExtractGaps() { diff --git a/test/jalview/analysis/AlignmentAnnotationUtilsTest.java b/test/jalview/analysis/AlignmentAnnotationUtilsTest.java index c3191e8..610a60a 100644 --- a/test/jalview/analysis/AlignmentAnnotationUtilsTest.java +++ b/test/jalview/analysis/AlignmentAnnotationUtilsTest.java @@ -28,6 +28,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import java.io.IOException; @@ -38,11 +39,20 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class AlignmentAnnotationUtilsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // 4 sequences x 13 positions final static String EOL = "\n"; diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index 449514a..8a667b3 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -40,6 +40,7 @@ import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.io.FormatAdapter; import jalview.util.MapList; @@ -53,10 +54,19 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignmentUtilsTests { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static Sequence ts = new Sequence("short", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm"); diff --git a/test/jalview/analysis/AnnotationSorterTest.java b/test/jalview/analysis/AnnotationSorterTest.java index 9dd2972..1c5a7f9 100644 --- a/test/jalview/analysis/AnnotationSorterTest.java +++ b/test/jalview/analysis/AnnotationSorterTest.java @@ -27,16 +27,26 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class AnnotationSorterTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static final int NUM_SEQS = 6; private static final int NUM_ANNS = 7; diff --git a/test/jalview/analysis/CodingUtilsTest.java b/test/jalview/analysis/CodingUtilsTest.java index 38ee3fe..b66c499 100644 --- a/test/jalview/analysis/CodingUtilsTest.java +++ b/test/jalview/analysis/CodingUtilsTest.java @@ -23,13 +23,23 @@ package jalview.analysis; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.util.Arrays; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class CodingUtilsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testDecodeCodon() { diff --git a/test/jalview/analysis/ConservationTest.java b/test/jalview/analysis/ConservationTest.java index 123fcd6..5d21672 100644 --- a/test/jalview/analysis/ConservationTest.java +++ b/test/jalview/analysis/ConservationTest.java @@ -5,16 +5,26 @@ import static org.testng.Assert.assertTrue; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ConservationTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testRecordConservation() { diff --git a/test/jalview/analysis/CrossRefTest.java b/test/jalview/analysis/CrossRefTest.java index a85dcef..95be1ff 100644 --- a/test/jalview/analysis/CrossRefTest.java +++ b/test/jalview/analysis/CrossRefTest.java @@ -37,6 +37,7 @@ import jalview.datamodel.Mapping; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.util.DBRefUtils; import jalview.util.MapList; import jalview.ws.SequenceFetcher; @@ -46,10 +47,19 @@ import java.util.ArrayList; import java.util.List; import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class CrossRefTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testFindXDbRefs() { diff --git a/test/jalview/analysis/DnaAlignmentGenerator.java b/test/jalview/analysis/DnaAlignmentGenerator.java index 69e5c23..5f6842e 100644 --- a/test/jalview/analysis/DnaAlignmentGenerator.java +++ b/test/jalview/analysis/DnaAlignmentGenerator.java @@ -24,11 +24,14 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.FastaFile; import java.util.Arrays; import java.util.Random; +import org.testng.annotations.BeforeClass; + /** * Generates, and outputs in Fasta format, a random DNA alignment for given * sequence length and count. Will regenerate the same alignment each time if @@ -50,6 +53,14 @@ import java.util.Random; */ public class DnaAlignmentGenerator { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static final char GAP = '-'; private static final char ZERO = '0'; @@ -58,6 +69,7 @@ public class DnaAlignmentGenerator private Random random; + /** * Outputs a DNA 'alignment' where each position is a random choice from * 'GTCA-'. diff --git a/test/jalview/analysis/DnaTest.java b/test/jalview/analysis/DnaTest.java index 1851517..4c12905 100644 --- a/test/jalview/analysis/DnaTest.java +++ b/test/jalview/analysis/DnaTest.java @@ -32,14 +32,23 @@ import jalview.datamodel.ColumnSelection; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignViewport; +import jalview.gui.JvOptionPane; 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" diff --git a/test/jalview/analysis/FinderTest.java b/test/jalview/analysis/FinderTest.java index 971a8c6..bae98c5 100644 --- a/test/jalview/analysis/FinderTest.java +++ b/test/jalview/analysis/FinderTest.java @@ -10,6 +10,7 @@ import jalview.datamodel.SearchResultMatchI; import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; @@ -20,6 +21,13 @@ import org.testng.annotations.Test; public class FinderTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private AlignFrame af; private AlignmentI al; diff --git a/test/jalview/analysis/GroupingTest.java b/test/jalview/analysis/GroupingTest.java index cea8ae4..184f9fb 100644 --- a/test/jalview/analysis/GroupingTest.java +++ b/test/jalview/analysis/GroupingTest.java @@ -26,14 +26,23 @@ import jalview.datamodel.ColumnSelection; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.util.Arrays; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class GroupingTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Sequence s1 = new Sequence("s1", "AAAADDDDEEEE"); Sequence s2 = new Sequence("s2", "AAAADDDDEEEE"); diff --git a/test/jalview/analysis/ParsePropertiesTest.java b/test/jalview/analysis/ParsePropertiesTest.java index d692bbb..cd253e0 100644 --- a/test/jalview/analysis/ParsePropertiesTest.java +++ b/test/jalview/analysis/ParsePropertiesTest.java @@ -28,15 +28,24 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class ParsePropertiesTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private Alignment al; private ParseProperties pp; diff --git a/test/jalview/analysis/RnaTest.java b/test/jalview/analysis/RnaTest.java index 9d35a19..814d2d4 100644 --- a/test/jalview/analysis/RnaTest.java +++ b/test/jalview/analysis/RnaTest.java @@ -27,13 +27,23 @@ import static org.testng.AssertJUnit.assertTrue; import static org.testng.AssertJUnit.fail; import jalview.analysis.SecStrConsensus.SimpleBP; +import jalview.gui.JvOptionPane; import java.util.Vector; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class RnaTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetSimpleBPs() throws WUSSParseException { diff --git a/test/jalview/analysis/SeqsetUtilsTest.java b/test/jalview/analysis/SeqsetUtilsTest.java index b4d079a..11cb10c 100644 --- a/test/jalview/analysis/SeqsetUtilsTest.java +++ b/test/jalview/analysis/SeqsetUtilsTest.java @@ -25,10 +25,12 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.util.Hashtable; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -37,6 +39,15 @@ import org.testng.annotations.Test; */ public class SeqsetUtilsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + /** * test for JAL-2046 bug - duplication of sequence features on reconstructed * alignment diff --git a/test/jalview/analysis/SequenceIdMatcherTest.java b/test/jalview/analysis/SequenceIdMatcherTest.java index b071080..bbed9d3 100644 --- a/test/jalview/analysis/SequenceIdMatcherTest.java +++ b/test/jalview/analysis/SequenceIdMatcherTest.java @@ -25,12 +25,22 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.analysis.SequenceIdMatcher.SeqIdName; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceIdMatcherTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + /** * Test the method that checks for one sequence id starting with the other, * followed by an 'allowed' separator character diff --git a/test/jalview/analysis/TestAlignSeq.java b/test/jalview/analysis/TestAlignSeq.java index 43ebd63..9fc88ea 100644 --- a/test/jalview/analysis/TestAlignSeq.java +++ b/test/jalview/analysis/TestAlignSeq.java @@ -26,9 +26,11 @@ import static org.testng.AssertJUnit.assertNull; import jalview.datamodel.Mapping; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.PrintStream; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -41,6 +43,13 @@ import org.testng.annotations.Test; public class TestAlignSeq { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + SequenceI s1, s2, s3; /** diff --git a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java index 309790f..2b48032 100644 --- a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java +++ b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java @@ -24,14 +24,24 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FeatureScoreModelTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static String alntestFile = "FER1_MESCR/72-76 DVYIL\nFER1_SPIOL/71-75 DVYIL\nFER3_RAPSA/21-25 DVYVL\nFER1_MAIZE/73-77 DVYIL\n"; int[] sf1 = new int[] { 74, 74, 73, 73, 23, 23, -1, -1 }; diff --git a/test/jalview/bin/ArgsParserTest.java b/test/jalview/bin/ArgsParserTest.java index 20e43b8..0485db7 100644 --- a/test/jalview/bin/ArgsParserTest.java +++ b/test/jalview/bin/ArgsParserTest.java @@ -25,10 +25,21 @@ import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ArgsParserTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetValue() { diff --git a/test/jalview/bin/CacheTest.java b/test/jalview/bin/CacheTest.java index 803139f..e762dd5 100644 --- a/test/jalview/bin/CacheTest.java +++ b/test/jalview/bin/CacheTest.java @@ -22,6 +22,8 @@ package jalview.bin; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; @@ -32,6 +34,14 @@ import org.testng.annotations.Test; public class CacheTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private Locale locale; @BeforeClass(alwaysRun = true) diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index c79a043..69a3ef7 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -20,6 +20,8 @@ */ package jalview.bin; +import jalview.gui.JvOptionPane; + import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -28,12 +30,21 @@ import java.util.ArrayList; import org.testng.Assert; import org.testng.FileAssert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class CommandLineOperations { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static final int TEST_TIMEOUT = 4500; // Note longer timeout needed on // full test run than on // individual tests diff --git a/test/jalview/bin/JalviewLiteTest.java b/test/jalview/bin/JalviewLiteTest.java index 8276300..07e1b25 100644 --- a/test/jalview/bin/JalviewLiteTest.java +++ b/test/jalview/bin/JalviewLiteTest.java @@ -23,13 +23,23 @@ package jalview.bin; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; +import jalview.gui.JvOptionPane; + import java.util.Arrays; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JalviewLiteTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testSeparatorListToArray() { diff --git a/test/jalview/commands/EditCommandTest.java b/test/jalview/commands/EditCommandTest.java index 7fb80fb..3223042 100644 --- a/test/jalview/commands/EditCommandTest.java +++ b/test/jalview/commands/EditCommandTest.java @@ -29,9 +29,11 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -44,6 +46,13 @@ import org.testng.annotations.Test; public class EditCommandTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private EditCommand testee; private SequenceI[] seqs; diff --git a/test/jalview/commands/TrimRegionCommandTest.java b/test/jalview/commands/TrimRegionCommandTest.java index d593d41..70c54fb 100644 --- a/test/jalview/commands/TrimRegionCommandTest.java +++ b/test/jalview/commands/TrimRegionCommandTest.java @@ -26,7 +26,9 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -38,6 +40,14 @@ import org.testng.annotations.Test; */ public class TrimRegionCommandTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private AlignmentI al; @BeforeMethod(alwaysRun = true) diff --git a/test/jalview/controller/AlignViewControllerTest.java b/test/jalview/controller/AlignViewControllerTest.java index 53eb171..7ac1452 100644 --- a/test/jalview/controller/AlignViewControllerTest.java +++ b/test/jalview/controller/AlignViewControllerTest.java @@ -32,16 +32,26 @@ import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; import java.util.Arrays; import java.util.BitSet; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignViewControllerTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testFindColumnsWithFeature() { diff --git a/test/jalview/datamodel/AlignedCodonFrameTest.java b/test/jalview/datamodel/AlignedCodonFrameTest.java index 2e0793e..fb4073a 100644 --- a/test/jalview/datamodel/AlignedCodonFrameTest.java +++ b/test/jalview/datamodel/AlignedCodonFrameTest.java @@ -27,16 +27,25 @@ import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; +import jalview.gui.JvOptionPane; import jalview.util.MapList; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignedCodonFrameTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test the method that locates the first aligned sequence that has a mapping. */ diff --git a/test/jalview/datamodel/AlignedCodonIteratorTest.java b/test/jalview/datamodel/AlignedCodonIteratorTest.java index cc87f29..dd3ec7c 100644 --- a/test/jalview/datamodel/AlignedCodonIteratorTest.java +++ b/test/jalview/datamodel/AlignedCodonIteratorTest.java @@ -23,11 +23,13 @@ package jalview.datamodel; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; +import jalview.gui.JvOptionPane; import jalview.util.MapList; import java.util.Iterator; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -38,6 +40,14 @@ import org.testng.annotations.Test; */ public class AlignedCodonIteratorTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test normal case for iterating over aligned codons. */ diff --git a/test/jalview/datamodel/AlignedCodonTest.java b/test/jalview/datamodel/AlignedCodonTest.java index 29d6801..36f06f1 100644 --- a/test/jalview/datamodel/AlignedCodonTest.java +++ b/test/jalview/datamodel/AlignedCodonTest.java @@ -24,11 +24,21 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignedCodonTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testEquals() { diff --git a/test/jalview/datamodel/AlignmentAnnotationTests.java b/test/jalview/datamodel/AlignmentAnnotationTests.java index 1aff519..dc86f78 100644 --- a/test/jalview/datamodel/AlignmentAnnotationTests.java +++ b/test/jalview/datamodel/AlignmentAnnotationTests.java @@ -24,12 +24,22 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import jalview.analysis.AlignSeq; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignmentAnnotationTests { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testCopyConstructor() { diff --git a/test/jalview/datamodel/AlignmentTest.java b/test/jalview/datamodel/AlignmentTest.java index 7958e9b..4c51229 100644 --- a/test/jalview/datamodel/AlignmentTest.java +++ b/test/jalview/datamodel/AlignmentTest.java @@ -28,6 +28,7 @@ import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignedCodonFrame.SequenceToSequenceMapping; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.io.FormatAdapter; import jalview.util.MapList; @@ -39,6 +40,7 @@ import java.util.Iterator; import java.util.List; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -50,6 +52,14 @@ import org.testng.annotations.Test; */ public class AlignmentTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // @formatter:off private static final String TEST_DATA = "# STOCKHOLM 1.0\n" + diff --git a/test/jalview/datamodel/AlignmentViewTest.java b/test/jalview/datamodel/AlignmentViewTest.java index 3d09f9f..594d6e6 100644 --- a/test/jalview/datamodel/AlignmentViewTest.java +++ b/test/jalview/datamodel/AlignmentViewTest.java @@ -22,10 +22,21 @@ package jalview.datamodel; import static org.testng.Assert.assertEquals; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignmentViewTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetVisibleAlignmentGapChar() { diff --git a/test/jalview/datamodel/ColumnSelectionTest.java b/test/jalview/datamodel/ColumnSelectionTest.java index ec528c5..a9ad4c2 100644 --- a/test/jalview/datamodel/ColumnSelectionTest.java +++ b/test/jalview/datamodel/ColumnSelectionTest.java @@ -26,17 +26,27 @@ import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; import static org.testng.AssertJUnit.fail; +import jalview.gui.JvOptionPane; + import java.util.Arrays; import java.util.BitSet; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ColumnSelectionTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testAddElement() { diff --git a/test/jalview/datamodel/DBRefEntryTest.java b/test/jalview/datamodel/DBRefEntryTest.java index 87e7082..c8f998b 100644 --- a/test/jalview/datamodel/DBRefEntryTest.java +++ b/test/jalview/datamodel/DBRefEntryTest.java @@ -25,13 +25,22 @@ import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; import jalview.util.MapList; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class DBRefEntryTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Tests for the method that compares equality of reference (but not mapping) */ diff --git a/test/jalview/datamodel/HiddenSequencesTest.java b/test/jalview/datamodel/HiddenSequencesTest.java index 42fc58b..cae3536 100644 --- a/test/jalview/datamodel/HiddenSequencesTest.java +++ b/test/jalview/datamodel/HiddenSequencesTest.java @@ -30,15 +30,25 @@ import static org.testng.AssertJUnit.assertTrue; import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; import jalview.gui.AlignViewport; +import jalview.gui.JvOptionPane; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @Test(singleThreaded = true) public class HiddenSequencesTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + static int SEQ_COUNT = 10; SequenceI[] seqs; diff --git a/test/jalview/datamodel/MappingTest.java b/test/jalview/datamodel/MappingTest.java index b326d90..d739369 100644 --- a/test/jalview/datamodel/MappingTest.java +++ b/test/jalview/datamodel/MappingTest.java @@ -23,10 +23,12 @@ package jalview.datamodel; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertSame; +import jalview.gui.JvOptionPane; import jalview.util.MapList; import java.util.Arrays; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -34,6 +36,14 @@ import org.testng.annotations.Test; */ public class MappingTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * trite test of the intersectVisContigs method for a simple DNA -> Protein * exon map and a range of visContigs diff --git a/test/jalview/datamodel/MappingTypeTest.java b/test/jalview/datamodel/MappingTypeTest.java index a7b28a7..f6a1116 100644 --- a/test/jalview/datamodel/MappingTypeTest.java +++ b/test/jalview/datamodel/MappingTypeTest.java @@ -23,13 +23,21 @@ package jalview.datamodel; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertSame; -import jalview.datamodel.MappingType; +import jalview.gui.JvOptionPane; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class MappingTypeTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetInverse() { diff --git a/test/jalview/datamodel/MatchTest.java b/test/jalview/datamodel/MatchTest.java index 95764d0..e7d04d7 100644 --- a/test/jalview/datamodel/MatchTest.java +++ b/test/jalview/datamodel/MatchTest.java @@ -24,11 +24,21 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class MatchTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testToString() { diff --git a/test/jalview/datamodel/PDBEntryTest.java b/test/jalview/datamodel/PDBEntryTest.java index e9d5cb2..cf4294e 100644 --- a/test/jalview/datamodel/PDBEntryTest.java +++ b/test/jalview/datamodel/PDBEntryTest.java @@ -31,15 +31,24 @@ import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; import jalview.datamodel.PDBEntry.Type; +import jalview.gui.JvOptionPane; //import org.testng.Assert; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PDBEntryTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeMethod(alwaysRun = true) public void setUp() throws Exception { diff --git a/test/jalview/datamodel/ResidueCountTest.java b/test/jalview/datamodel/ResidueCountTest.java index f98e3d3..ac3ee69 100644 --- a/test/jalview/datamodel/ResidueCountTest.java +++ b/test/jalview/datamodel/ResidueCountTest.java @@ -5,12 +5,22 @@ import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import jalview.datamodel.ResidueCount.SymbolCounts; +import jalview.gui.JvOptionPane; import org.junit.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ResidueCountTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test a mix of add and put for nucleotide counting */ diff --git a/test/jalview/datamodel/SearchResultsTest.java b/test/jalview/datamodel/SearchResultsTest.java index 19e89d2..f1a6e20 100644 --- a/test/jalview/datamodel/SearchResultsTest.java +++ b/test/jalview/datamodel/SearchResultsTest.java @@ -25,14 +25,24 @@ import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.util.BitSet; import org.junit.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SearchResultsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testToString() { diff --git a/test/jalview/datamodel/SeqCigarTest.java b/test/jalview/datamodel/SeqCigarTest.java index bb6581f..ab25aa6 100644 --- a/test/jalview/datamodel/SeqCigarTest.java +++ b/test/jalview/datamodel/SeqCigarTest.java @@ -23,8 +23,10 @@ package jalview.datamodel; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; +import jalview.gui.JvOptionPane; import jalview.util.Comparison; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -32,6 +34,14 @@ import org.testng.annotations.Test; */ public class SeqCigarTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testFindPosition() { diff --git a/test/jalview/datamodel/SequenceDummyTest.java b/test/jalview/datamodel/SequenceDummyTest.java index e263843..fa7602b 100644 --- a/test/jalview/datamodel/SequenceDummyTest.java +++ b/test/jalview/datamodel/SequenceDummyTest.java @@ -23,11 +23,22 @@ package jalview.datamodel; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @Test public class SequenceDummyTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * test for become method */ diff --git a/test/jalview/datamodel/SequenceFeatureTest.java b/test/jalview/datamodel/SequenceFeatureTest.java index 5150337..e87d7e5 100644 --- a/test/jalview/datamodel/SequenceFeatureTest.java +++ b/test/jalview/datamodel/SequenceFeatureTest.java @@ -26,10 +26,21 @@ import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceFeatureTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testCopyConstructor() { diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index 065bed7..08e6f7d 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -29,6 +29,7 @@ import static org.testng.AssertJUnit.assertTrue; import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; import jalview.datamodel.PDBEntry.Type; +import jalview.gui.JvOptionPane; import jalview.util.MapList; import java.io.File; @@ -38,11 +39,20 @@ import java.util.List; import java.util.Vector; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class SequenceTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Sequence seq; @BeforeMethod(alwaysRun = true) diff --git a/test/jalview/datamodel/xdb/embl/EmblEntryTest.java b/test/jalview/datamodel/xdb/embl/EmblEntryTest.java index 8ed5cc4..4672574 100644 --- a/test/jalview/datamodel/xdb/embl/EmblEntryTest.java +++ b/test/jalview/datamodel/xdb/embl/EmblEntryTest.java @@ -28,16 +28,26 @@ import jalview.analysis.SequenceIdMatcher; import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.util.MapList; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class EmblEntryTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetCdsRanges() { diff --git a/test/jalview/datamodel/xdb/embl/EmblFileTest.java b/test/jalview/datamodel/xdb/embl/EmblFileTest.java index 906436f..7510de1 100644 --- a/test/jalview/datamodel/xdb/embl/EmblFileTest.java +++ b/test/jalview/datamodel/xdb/embl/EmblFileTest.java @@ -24,14 +24,23 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import jalview.datamodel.DBRefEntry; +import jalview.gui.JvOptionPane; import java.util.Vector; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class EmblFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetEmblFile() { diff --git a/test/jalview/ext/android/SparseIntArrayTest.java b/test/jalview/ext/android/SparseIntArrayTest.java index 0ce0467..2da45ed 100644 --- a/test/jalview/ext/android/SparseIntArrayTest.java +++ b/test/jalview/ext/android/SparseIntArrayTest.java @@ -3,6 +3,9 @@ package jalview.ext.android; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /* @@ -11,6 +14,14 @@ import org.testng.annotations.Test; */ public class SparseIntArrayTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testPut() { diff --git a/test/jalview/ext/android/SparseShortArrayTest.java b/test/jalview/ext/android/SparseShortArrayTest.java index 351f640..2a89e65 100644 --- a/test/jalview/ext/android/SparseShortArrayTest.java +++ b/test/jalview/ext/android/SparseShortArrayTest.java @@ -3,10 +3,21 @@ package jalview.ext.android; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SparseShortArrayTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testPut() { diff --git a/test/jalview/ext/ensembl/EnsemblCdnaTest.java b/test/jalview/ext/ensembl/EnsemblCdnaTest.java index 95d371a..fb0204b 100644 --- a/test/jalview/ext/ensembl/EnsemblCdnaTest.java +++ b/test/jalview/ext/ensembl/EnsemblCdnaTest.java @@ -28,6 +28,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.gff.SequenceOntologyFactory; import jalview.io.gff.SequenceOntologyLite; import jalview.util.MapList; @@ -41,6 +42,14 @@ import org.testng.annotations.Test; public class EnsemblCdnaTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeClass(alwaysRun = true) public void setUp() { diff --git a/test/jalview/ext/ensembl/EnsemblCdsTest.java b/test/jalview/ext/ensembl/EnsemblCdsTest.java index c644e83..b7f9f8d 100644 --- a/test/jalview/ext/ensembl/EnsemblCdsTest.java +++ b/test/jalview/ext/ensembl/EnsemblCdsTest.java @@ -27,6 +27,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.gff.SequenceOntologyFactory; import jalview.io.gff.SequenceOntologyLite; import jalview.util.MapList; @@ -40,6 +41,14 @@ import org.testng.annotations.Test; public class EnsemblCdsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeClass(alwaysRun = true) public void setUp() { diff --git a/test/jalview/ext/ensembl/EnsemblGeneTest.java b/test/jalview/ext/ensembl/EnsemblGeneTest.java index 33bb189..6cfd85b 100644 --- a/test/jalview/ext/ensembl/EnsemblGeneTest.java +++ b/test/jalview/ext/ensembl/EnsemblGeneTest.java @@ -29,6 +29,7 @@ import jalview.api.FeatureSettingsModelI; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.gff.SequenceOntologyFactory; import jalview.io.gff.SequenceOntologyLite; import jalview.util.MapList; @@ -42,6 +43,14 @@ import org.testng.annotations.Test; public class EnsemblGeneTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeClass(alwaysRun = true) public void setUp() { diff --git a/test/jalview/ext/ensembl/EnsemblGenomeTest.java b/test/jalview/ext/ensembl/EnsemblGenomeTest.java index 991cd96..654797c 100644 --- a/test/jalview/ext/ensembl/EnsemblGenomeTest.java +++ b/test/jalview/ext/ensembl/EnsemblGenomeTest.java @@ -27,6 +27,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.gff.SequenceOntologyFactory; import jalview.io.gff.SequenceOntologyLite; import jalview.util.MapList; @@ -39,6 +40,14 @@ import org.testng.annotations.Test; public class EnsemblGenomeTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeClass(alwaysRun = true) public void setUp() { diff --git a/test/jalview/ext/ensembl/EnsemblProteinTest.java b/test/jalview/ext/ensembl/EnsemblProteinTest.java index d44a82b..f6a4c8c 100644 --- a/test/jalview/ext/ensembl/EnsemblProteinTest.java +++ b/test/jalview/ext/ensembl/EnsemblProteinTest.java @@ -22,12 +22,22 @@ package jalview.ext.ensembl; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class EnsemblProteinTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testIsValidReference() throws Exception { diff --git a/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java b/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java index d3a6e32..50fab08 100644 --- a/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java +++ b/test/jalview/ext/ensembl/EnsemblSeqProxyTest.java @@ -28,6 +28,7 @@ import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; import jalview.datamodel.Alignment; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.io.FastaFile; import jalview.io.FileParse; @@ -45,6 +46,14 @@ import org.testng.annotations.Test; public class EnsemblSeqProxyTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static final Object[][] allSeqs = new Object[][] { { new EnsemblProtein(), diff --git a/test/jalview/ext/ensembl/EnsemblXrefTest.java b/test/jalview/ext/ensembl/EnsemblXrefTest.java index 9ef2843..9cc6627 100644 --- a/test/jalview/ext/ensembl/EnsemblXrefTest.java +++ b/test/jalview/ext/ensembl/EnsemblXrefTest.java @@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import jalview.datamodel.DBRefEntry; +import jalview.gui.JvOptionPane; import java.io.BufferedReader; import java.io.IOException; @@ -31,10 +32,19 @@ import java.io.StringReader; import java.net.URL; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class EnsemblXrefTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + //@formatter:off private static final String JSON = "[{\"primary_id\":\"CCDS5863\",\"dbname\":\"CCDS\"}," + diff --git a/test/jalview/ext/htsjdk/TestHtsContigDb.java b/test/jalview/ext/htsjdk/TestHtsContigDb.java index bdc14db..350b599 100644 --- a/test/jalview/ext/htsjdk/TestHtsContigDb.java +++ b/test/jalview/ext/htsjdk/TestHtsContigDb.java @@ -21,10 +21,12 @@ package jalview.ext.htsjdk; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.File; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -33,6 +35,14 @@ import org.testng.annotations.Test; */ public class TestHtsContigDb { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public final void testHTSReferenceSequence() throws Exception { diff --git a/test/jalview/ext/jmol/JmolCommandsTest.java b/test/jalview/ext/jmol/JmolCommandsTest.java index 89ab580..439e188 100644 --- a/test/jalview/ext/jmol/JmolCommandsTest.java +++ b/test/jalview/ext/jmol/JmolCommandsTest.java @@ -25,15 +25,24 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.gui.SequenceRenderer; import jalview.structure.StructureMappingcommandSet; import jalview.structure.StructureSelectionManager; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JmolCommandsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetColourBySequenceCommand_noFeatures() { diff --git a/test/jalview/ext/jmol/JmolParserTest.java b/test/jalview/ext/jmol/JmolParserTest.java index b2d3253..186a94a 100644 --- a/test/jalview/ext/jmol/JmolParserTest.java +++ b/test/jalview/ext/jmol/JmolParserTest.java @@ -29,6 +29,7 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.io.FileLoader; import jalview.structure.StructureImportSettings; @@ -37,6 +38,7 @@ import jalview.structure.StructureImportSettings.StructureParser; import java.util.Vector; import org.jmol.c.STR; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -48,6 +50,14 @@ import MCview.PDBfile; */ public class JmolParserTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /* * 1GAQ has been reduced to alpha carbons only * 1QCF is the full PDB file including headers, HETATM etc diff --git a/test/jalview/ext/jmol/JmolViewerTest.java b/test/jalview/ext/jmol/JmolViewerTest.java index 10224fa..59d7d07 100644 --- a/test/jalview/ext/jmol/JmolViewerTest.java +++ b/test/jalview/ext/jmol/JmolViewerTest.java @@ -26,6 +26,7 @@ import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.gui.Preferences; import jalview.gui.StructureViewer; import jalview.gui.StructureViewer.ViewerType; @@ -39,6 +40,13 @@ import org.testng.annotations.Test; public class JmolViewerTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * @throws java.lang.Exception */ diff --git a/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java b/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java index 254e082..58ff990 100644 --- a/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java +++ b/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java @@ -21,6 +21,7 @@ package jalview.ext.jmol; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import java.io.File; @@ -29,6 +30,8 @@ import java.util.HashSet; import java.util.Set; import java.util.Vector; +import org.testng.annotations.BeforeClass; + import MCview.PDBfile; /** @@ -43,6 +46,13 @@ import MCview.PDBfile; public class JmolVsJalviewPDBParserEndToEndTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static void main(String[] args) { if (args == null || args[0] == null) diff --git a/test/jalview/ext/paradise/TestAnnotate3D.java b/test/jalview/ext/paradise/TestAnnotate3D.java index 4110863..1b70e8d 100644 --- a/test/jalview/ext/paradise/TestAnnotate3D.java +++ b/test/jalview/ext/paradise/TestAnnotate3D.java @@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.FastaFile; import jalview.io.FormatAdapter; @@ -34,6 +35,7 @@ import java.util.Iterator; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import MCview.PDBfile; @@ -43,6 +45,13 @@ import compbio.util.FileUtil; public class TestAnnotate3D { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Network" }, enabled = true) public void test1GIDbyId() throws Exception { diff --git a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java index 29c7d16..d0ea751 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java @@ -23,16 +23,27 @@ package jalview.ext.rbvi.chimera; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.awt.Color; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ChimeraCommandsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testAddColourRange() { diff --git a/test/jalview/ext/rbvi/chimera/ChimeraConnect.java b/test/jalview/ext/rbvi/chimera/ChimeraConnect.java index a5393ec..4d904cf 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraConnect.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraConnect.java @@ -23,6 +23,9 @@ package jalview.ext.rbvi.chimera; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import ext.edu.ucsf.rbvi.strucviz2.ChimeraManager; @@ -31,6 +34,13 @@ import ext.edu.ucsf.rbvi.strucviz2.StructureManager; public class ChimeraConnect { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testLaunchAndExit() { diff --git a/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java b/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java index 93a98b8..9f53cad 100644 --- a/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java +++ b/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java @@ -27,6 +27,7 @@ import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.gui.Preferences; import jalview.gui.StructureViewer; import jalview.gui.StructureViewer.ViewerType; @@ -40,6 +41,13 @@ import org.testng.annotations.Test; public class JalviewChimeraView { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * @throws java.lang.Exception */ diff --git a/test/jalview/ext/so/SequenceOntologyTest.java b/test/jalview/ext/so/SequenceOntologyTest.java index 1bc802e..b76a295 100644 --- a/test/jalview/ext/so/SequenceOntologyTest.java +++ b/test/jalview/ext/so/SequenceOntologyTest.java @@ -23,6 +23,7 @@ package jalview.ext.so; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; import jalview.io.gff.SequenceOntologyI; import org.testng.annotations.BeforeClass; @@ -30,6 +31,14 @@ import org.testng.annotations.Test; public class SequenceOntologyTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private SequenceOntologyI so; @BeforeClass(alwaysRun = true) diff --git a/test/jalview/fts/core/FTSRestClientTest.java b/test/jalview/fts/core/FTSRestClientTest.java index b751b77..44fe8d0 100644 --- a/test/jalview/fts/core/FTSRestClientTest.java +++ b/test/jalview/fts/core/FTSRestClientTest.java @@ -22,17 +22,27 @@ package jalview.fts.core; import jalview.fts.api.FTSDataColumnI; import jalview.fts.api.FTSDataColumnI.FTSDataColumnGroupI; +import jalview.gui.JvOptionPane; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class FTSRestClientTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private FTSRestClient ftsRestClient; @BeforeMethod(alwaysRun = true) diff --git a/test/jalview/fts/service/pdb/PDBFTSPanelTest.java b/test/jalview/fts/service/pdb/PDBFTSPanelTest.java index 69792bb..901bffc 100644 --- a/test/jalview/fts/service/pdb/PDBFTSPanelTest.java +++ b/test/jalview/fts/service/pdb/PDBFTSPanelTest.java @@ -23,16 +23,26 @@ package jalview.fts.service.pdb; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import javax.swing.JInternalFrame; import javax.swing.JTextField; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PDBFTSPanelTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeMethod(alwaysRun = true) public void setUp() throws Exception { diff --git a/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java b/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java index 8faec58..bbd45aa 100644 --- a/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java +++ b/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java @@ -26,6 +26,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.fts.api.FTSDataColumnI; import jalview.fts.core.FTSRestRequest; import jalview.fts.core.FTSRestResponse; +import jalview.gui.JvOptionPane; import java.io.BufferedReader; import java.io.FileReader; @@ -42,6 +43,7 @@ import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import org.testng.Assert; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -54,6 +56,13 @@ import com.sun.jersey.api.client.config.DefaultClientConfig; public class PDBFTSRestClientTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @BeforeMethod(alwaysRun = true) public void setUp() throws Exception { diff --git a/test/jalview/gui/AlignFrameTest.java b/test/jalview/gui/AlignFrameTest.java index b2ef3f7..60db9dd 100644 --- a/test/jalview/gui/AlignFrameTest.java +++ b/test/jalview/gui/AlignFrameTest.java @@ -32,11 +32,19 @@ import jalview.datamodel.SequenceI; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AlignFrameTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testHideFeatureColumns() { diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index dfe0e68..8a550a7 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -56,6 +56,13 @@ import org.testng.annotations.Test; public class AlignViewportTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + AlignmentI al; AlignViewport testee; diff --git a/test/jalview/gui/AnnotationChooserTest.java b/test/jalview/gui/AnnotationChooserTest.java index 6621a94..e742977 100644 --- a/test/jalview/gui/AnnotationChooserTest.java +++ b/test/jalview/gui/AnnotationChooserTest.java @@ -46,6 +46,7 @@ import java.util.List; import javax.swing.JButton; import javax.swing.JPanel; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -57,6 +58,14 @@ import org.testng.annotations.Test; */ public class AnnotationChooserTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // 4 sequences x 13 positions final static String TEST_DATA = ">FER_CAPAA Ferredoxin\n" + "TIETHKEAELVG-\n" diff --git a/test/jalview/gui/AppVarnaTest.java b/test/jalview/gui/AppVarnaTest.java index 92770d5..17dbf5f 100644 --- a/test/jalview/gui/AppVarnaTest.java +++ b/test/jalview/gui/AppVarnaTest.java @@ -24,10 +24,19 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AppVarnaTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testReplaceOddGaps() { diff --git a/test/jalview/gui/FontChooserTest.java b/test/jalview/gui/FontChooserTest.java index 355fdc3..57d561e 100644 --- a/test/jalview/gui/FontChooserTest.java +++ b/test/jalview/gui/FontChooserTest.java @@ -24,11 +24,19 @@ import java.awt.Canvas; import java.awt.Font; import java.awt.FontMetrics; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FontChooserTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Not a real test as it runs no methods on FontChooser and makes no * assertions, but this method writes to sysout the names of any (currently diff --git a/test/jalview/gui/HelpTest.java b/test/jalview/gui/HelpTest.java index 26132b9..d2188db 100644 --- a/test/jalview/gui/HelpTest.java +++ b/test/jalview/gui/HelpTest.java @@ -30,10 +30,19 @@ import javax.help.HelpSet; import javax.help.HelpSetException; import javax.help.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class HelpTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void checkHelpTargets() throws HelpSetException { diff --git a/test/jalview/gui/JAL1353bugdemo.java b/test/jalview/gui/JAL1353bugdemo.java index 489fe4f..87ceed8 100644 --- a/test/jalview/gui/JAL1353bugdemo.java +++ b/test/jalview/gui/JAL1353bugdemo.java @@ -39,6 +39,13 @@ public class JAL1353bugdemo { @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { } diff --git a/test/jalview/gui/JvOptionPaneTest.java b/test/jalview/gui/JvOptionPaneTest.java index 86409a4..02e3b65 100644 --- a/test/jalview/gui/JvOptionPaneTest.java +++ b/test/jalview/gui/JvOptionPaneTest.java @@ -30,12 +30,19 @@ import javax.swing.JFrame; import javax.swing.JPanel; import org.testng.Assert; -import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JvOptionPaneTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Component parentComponent = null; String message = "Hello World!"; @@ -52,12 +59,6 @@ public class JvOptionPaneTest Object[] selectionValues = null; - @BeforeMethod(alwaysRun = true) - public void setUp() - { - JvOptionPane.setInteractiveMode(false); - JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); - } @Test(groups = { "Functional" }) public void showConfirmDialogFamilyTest() diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java index f1358d8..5e65cc2 100644 --- a/test/jalview/gui/JvSwingUtilsTest.java +++ b/test/jalview/gui/JvSwingUtilsTest.java @@ -25,11 +25,19 @@ import static org.testng.AssertJUnit.assertFalse; import javax.swing.JScrollBar; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JvSwingUtilsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetScrollBarProportion() { diff --git a/test/jalview/gui/PaintRefresherTest.java b/test/jalview/gui/PaintRefresherTest.java index 212bcce..5167eb3 100644 --- a/test/jalview/gui/PaintRefresherTest.java +++ b/test/jalview/gui/PaintRefresherTest.java @@ -36,11 +36,20 @@ import java.util.Map; import javax.swing.JPanel; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PaintRefresherTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // TODO would prefer PaintRefresher to be a single rather than static @BeforeMethod(alwaysRun = true) public void setUp() diff --git a/test/jalview/gui/PopupMenuTest.java b/test/jalview/gui/PopupMenuTest.java index 14354ff..c448169 100644 --- a/test/jalview/gui/PopupMenuTest.java +++ b/test/jalview/gui/PopupMenuTest.java @@ -47,11 +47,20 @@ import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.JSeparator; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PopupMenuTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // 4 sequences x 13 positions final static String TEST_DATA = ">FER_CAPAA Ferredoxin\n" + "TIETHKEAELVG-\n" diff --git a/test/jalview/gui/ProgressBarTest.java b/test/jalview/gui/ProgressBarTest.java index 4346420..a1715e9 100644 --- a/test/jalview/gui/ProgressBarTest.java +++ b/test/jalview/gui/ProgressBarTest.java @@ -31,11 +31,19 @@ import javax.swing.JLabel; import javax.swing.JPanel; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ProgressBarTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private JPanel statusPanel; private JLabel statusBar; diff --git a/test/jalview/gui/SequenceRendererTest.java b/test/jalview/gui/SequenceRendererTest.java index aa3b756..81289b0 100644 --- a/test/jalview/gui/SequenceRendererTest.java +++ b/test/jalview/gui/SequenceRendererTest.java @@ -30,11 +30,19 @@ import jalview.schemes.ZappoColourScheme; import java.awt.Color; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceRendererTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetResidueBoxColour_zappo() { diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index 446d32d..b7eef0f 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -33,11 +33,20 @@ import jalview.jbgui.GStructureChooser.FilterOption; import java.util.Vector; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class StructureChooserTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Sequence seq; @BeforeMethod(alwaysRun = true) diff --git a/test/jalview/gui/StructureViewerTest.java b/test/jalview/gui/StructureViewerTest.java index f8e9133..c1c1d5c 100644 --- a/test/jalview/gui/StructureViewerTest.java +++ b/test/jalview/gui/StructureViewerTest.java @@ -6,10 +6,19 @@ import static org.testng.Assert.assertNull; import jalview.datamodel.PDBEntry; import jalview.datamodel.PDBEntry.Type; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class StructureViewerTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetUniquePdbFiles() { diff --git a/test/jalview/io/AnnotatedPDBFileInputTest.java b/test/jalview/io/AnnotatedPDBFileInputTest.java index b8c12c6..86fc236 100644 --- a/test/jalview/io/AnnotatedPDBFileInputTest.java +++ b/test/jalview/io/AnnotatedPDBFileInputTest.java @@ -31,6 +31,7 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.structure.StructureImportSettings; import jalview.structure.StructureImportSettings.StructureParser; @@ -44,6 +45,13 @@ import org.testng.annotations.Test; public class AnnotatedPDBFileInputTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + AlignmentI al; String pdbId; diff --git a/test/jalview/io/AnnotationFileIOTest.java b/test/jalview/io/AnnotationFileIOTest.java index c9b5f4a..bcaa7b1 100644 --- a/test/jalview/io/AnnotationFileIOTest.java +++ b/test/jalview/io/AnnotationFileIOTest.java @@ -25,17 +25,26 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignmentI; import jalview.datamodel.ColumnSelection; +import jalview.gui.JvOptionPane; import jalview.io.AnnotationFile.ViewDef; import java.io.File; import java.util.Hashtable; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class AnnotationFileIOTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + static String TestFiles[][] = { { "Test example annotation import/export", "examples/uniref50.fa", "examples/testdata/example_annot_file.jva" }, diff --git a/test/jalview/io/BioJsHTMLOutputTest.java b/test/jalview/io/BioJsHTMLOutputTest.java index 77aa0f6..24e6cf7 100644 --- a/test/jalview/io/BioJsHTMLOutputTest.java +++ b/test/jalview/io/BioJsHTMLOutputTest.java @@ -20,6 +20,7 @@ */ package jalview.io; +import jalview.gui.JvOptionPane; import jalview.json.binding.biojs.BioJSReleasePojo; import jalview.json.binding.biojs.BioJSRepositoryPojo; @@ -33,11 +34,19 @@ import java.util.TreeMap; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class BioJsHTMLOutputTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void getJalviewAlignmentAsJsonString() { diff --git a/test/jalview/io/CrossRef2xmlTests.java b/test/jalview/io/CrossRef2xmlTests.java index c55ddd9..eaf1e79 100644 --- a/test/jalview/io/CrossRef2xmlTests.java +++ b/test/jalview/io/CrossRef2xmlTests.java @@ -30,6 +30,7 @@ import jalview.gui.AlignFrame; import jalview.gui.CrossRefAction; import jalview.gui.Desktop; import jalview.gui.Jalview2XML; +import jalview.gui.JvOptionPane; import java.io.File; import java.io.IOException; @@ -38,12 +39,21 @@ import java.util.HashMap; import java.util.List; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @Test(singleThreaded = true) public class CrossRef2xmlTests extends Jalview2xmlBase { + @Override + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * test store and recovery of all reachable cross refs from all reachable * crossrefs for one or more fetched db refs. Currently, this test has a known diff --git a/test/jalview/io/FeaturesFileTest.java b/test/jalview/io/FeaturesFileTest.java index 602ce9f..79b819e 100644 --- a/test/jalview/io/FeaturesFileTest.java +++ b/test/jalview/io/FeaturesFileTest.java @@ -34,17 +34,26 @@ import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import java.awt.Color; import java.io.File; import java.io.IOException; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FeaturesFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static String simpleGffFile = "examples/testdata/simpleGff3.gff"; @Test(groups = { "Functional" }) diff --git a/test/jalview/io/FileIOTester.java b/test/jalview/io/FileIOTester.java index 2eb3703..26ece71 100644 --- a/test/jalview/io/FileIOTester.java +++ b/test/jalview/io/FileIOTester.java @@ -20,6 +20,8 @@ */ package jalview.io; +import jalview.gui.JvOptionPane; + import java.io.File; import java.io.IOException; @@ -35,6 +37,13 @@ import org.testng.annotations.Test; public class FileIOTester { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * @throws java.lang.Exception */ diff --git a/test/jalview/io/FormatAdapterTest.java b/test/jalview/io/FormatAdapterTest.java index d4242a7..38303d3 100644 --- a/test/jalview/io/FormatAdapterTest.java +++ b/test/jalview/io/FormatAdapterTest.java @@ -26,18 +26,27 @@ import static org.testng.AssertJUnit.fail; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class FormatAdapterTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test saving and re-reading in a specified format * diff --git a/test/jalview/io/HtmlFileTest.java b/test/jalview/io/HtmlFileTest.java index 6c13e26..d7eae8b 100644 --- a/test/jalview/io/HtmlFileTest.java +++ b/test/jalview/io/HtmlFileTest.java @@ -20,11 +20,21 @@ */ package jalview.io; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class HtmlFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }, enabled = false) public void test() { diff --git a/test/jalview/io/IdentifyFileTest.java b/test/jalview/io/IdentifyFileTest.java index c00cf06..584313b 100644 --- a/test/jalview/io/IdentifyFileTest.java +++ b/test/jalview/io/IdentifyFileTest.java @@ -24,13 +24,23 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class IdentifyFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }, dataProvider = "identifyFiles") public void testIdentify(String data, String expectedFileType) { diff --git a/test/jalview/io/JSONFileTest.java b/test/jalview/io/JSONFileTest.java index 3f7edd4..422e6d9 100644 --- a/test/jalview/io/JSONFileTest.java +++ b/test/jalview/io/JSONFileTest.java @@ -33,6 +33,7 @@ import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.json.binding.biojson.v1.ColourSchemeMapper; import jalview.schemes.ColourSchemeI; @@ -44,6 +45,7 @@ import java.util.List; import org.testng.Assert; import org.testng.AssertJUnit; import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -51,6 +53,13 @@ import org.testng.annotations.Test; public class JSONFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private int TEST_SEQ_HEIGHT = 0; private int TEST_GRP_HEIGHT = 0; diff --git a/test/jalview/io/Jalview2xmlBase.java b/test/jalview/io/Jalview2xmlBase.java index 7f38dec..15e18e3 100644 --- a/test/jalview/io/Jalview2xmlBase.java +++ b/test/jalview/io/Jalview2xmlBase.java @@ -25,6 +25,7 @@ import jalview.bin.Jalview; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.SequenceI; import jalview.gui.Desktop; +import jalview.gui.JvOptionPane; import java.util.Date; @@ -35,6 +36,13 @@ import org.testng.annotations.BeforeTest; public class Jalview2xmlBase { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * @throws java.lang.Exception */ diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index 3d53234..0b72406 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -41,6 +41,7 @@ import jalview.gui.AlignFrame; import jalview.gui.AlignmentPanel; import jalview.gui.Desktop; import jalview.gui.Jalview2XML; +import jalview.gui.JvOptionPane; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; @@ -56,12 +57,20 @@ import java.util.Map; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @Test(singleThreaded = true) public class Jalview2xmlTests extends Jalview2xmlBase { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testRNAStructureRecovery() throws Exception { diff --git a/test/jalview/io/JalviewExportPropertiesTests.java b/test/jalview/io/JalviewExportPropertiesTests.java index 164c259..75cd9a1 100644 --- a/test/jalview/io/JalviewExportPropertiesTests.java +++ b/test/jalview/io/JalviewExportPropertiesTests.java @@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.SequenceGroup; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -39,6 +40,13 @@ 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 */ diff --git a/test/jalview/io/NewickFileTests.java b/test/jalview/io/NewickFileTests.java index 4de36f2..179a895 100644 --- a/test/jalview/io/NewickFileTests.java +++ b/test/jalview/io/NewickFileTests.java @@ -26,6 +26,7 @@ import jalview.analysis.NJTree; import jalview.analysis.SequenceIdMatcher; import jalview.datamodel.SequenceI; import jalview.datamodel.SequenceNode; +import jalview.gui.JvOptionPane; import java.util.Arrays; import java.util.Collection; @@ -46,6 +47,13 @@ import org.testng.annotations.Test; public class NewickFileTests { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Factory public static Object[] factoryData() { diff --git a/test/jalview/io/PfamFormatInputTest.java b/test/jalview/io/PfamFormatInputTest.java index fb99865..17f38b0 100644 --- a/test/jalview/io/PfamFormatInputTest.java +++ b/test/jalview/io/PfamFormatInputTest.java @@ -21,14 +21,24 @@ package jalview.io; import jalview.datamodel.AlignmentI; +import jalview.gui.JvOptionPane; import java.io.IOException; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class PfamFormatInputTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testPfamFormatNoLimits() throws IOException { diff --git a/test/jalview/io/PhylipFileTests.java b/test/jalview/io/PhylipFileTests.java index fa57c3d..ec222fb 100644 --- a/test/jalview/io/PhylipFileTests.java +++ b/test/jalview/io/PhylipFileTests.java @@ -25,11 +25,13 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.IOException; import java.util.HashMap; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -45,6 +47,13 @@ import org.testng.annotations.Test; public class PhylipFileTests { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // interleaved file from // http://www.molecularevolution.org/molevolfiles/fileformats/dna.phy.dat // sequential file is the interleave file converted into sequential format diff --git a/test/jalview/io/RNAMLfileTest.java b/test/jalview/io/RNAMLfileTest.java index c084792..3453cdc 100644 --- a/test/jalview/io/RNAMLfileTest.java +++ b/test/jalview/io/RNAMLfileTest.java @@ -20,6 +20,8 @@ */ package jalview.io; +import jalview.gui.JvOptionPane; + import java.io.File; import org.testng.annotations.AfterClass; @@ -30,6 +32,13 @@ public class RNAMLfileTest { @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { } diff --git a/test/jalview/io/SequenceAnnotationReportTest.java b/test/jalview/io/SequenceAnnotationReportTest.java index 1392157..2895874 100644 --- a/test/jalview/io/SequenceAnnotationReportTest.java +++ b/test/jalview/io/SequenceAnnotationReportTest.java @@ -23,14 +23,24 @@ package jalview.io; import static org.testng.AssertJUnit.assertEquals; import jalview.datamodel.SequenceFeature; +import jalview.gui.JvOptionPane; import java.util.Hashtable; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceAnnotationReportTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAppendFeature_disulfideBond() { diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index 035f484..1c6a890 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -30,17 +30,26 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.File; import java.util.BitSet; import java.util.HashMap; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class StockholmFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + static String PfamFile = "examples/PF00111_seed.stk", RfamFile = "examples/RF00031_folded.stk"; diff --git a/test/jalview/io/TCoffeeScoreFileTest.java b/test/jalview/io/TCoffeeScoreFileTest.java index 181aabd..65feb64 100644 --- a/test/jalview/io/TCoffeeScoreFileTest.java +++ b/test/jalview/io/TCoffeeScoreFileTest.java @@ -20,6 +20,7 @@ */ package jalview.io; +import jalview.gui.JvOptionPane; import jalview.io.TCoffeeScoreFile.Block; import jalview.io.TCoffeeScoreFile.Header; @@ -29,11 +30,19 @@ import java.io.IOException; import java.util.List; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class TCoffeeScoreFileTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + final static File SCORE_FILE = new File( "test/jalview/io/tcoffee.score_ascii"); diff --git a/test/jalview/io/gff/ExonerateHelperTest.java b/test/jalview/io/gff/ExonerateHelperTest.java index dbacceb..e770a7b 100644 --- a/test/jalview/io/gff/ExonerateHelperTest.java +++ b/test/jalview/io/gff/ExonerateHelperTest.java @@ -35,6 +35,7 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; @@ -44,10 +45,19 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ExonerateHelperTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetMappingType() { diff --git a/test/jalview/io/gff/Gff3HelperTest.java b/test/jalview/io/gff/Gff3HelperTest.java index 4355e40..bf038ac 100644 --- a/test/jalview/io/gff/Gff3HelperTest.java +++ b/test/jalview/io/gff/Gff3HelperTest.java @@ -33,16 +33,25 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class Gff3HelperTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test processing one PASA GFF line giving a match from forward strand to * forward strand diff --git a/test/jalview/io/gff/GffHelperBaseTest.java b/test/jalview/io/gff/GffHelperBaseTest.java index a1032ef..7fb716f 100644 --- a/test/jalview/io/gff/GffHelperBaseTest.java +++ b/test/jalview/io/gff/GffHelperBaseTest.java @@ -24,15 +24,25 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.util.Arrays; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class GffHelperBaseTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test the method that parses lines like
* ID=2345;Name=Something,Another thing;Notes=Hello;Notes=World diff --git a/test/jalview/io/gff/GffHelperFactoryTest.java b/test/jalview/io/gff/GffHelperFactoryTest.java index cfe1d12..84725ff 100644 --- a/test/jalview/io/gff/GffHelperFactoryTest.java +++ b/test/jalview/io/gff/GffHelperFactoryTest.java @@ -24,11 +24,21 @@ import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class GffHelperFactoryTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetHelper() { diff --git a/test/jalview/io/gff/GffTests.java b/test/jalview/io/gff/GffTests.java index 221f612..2cd3887 100644 --- a/test/jalview/io/gff/GffTests.java +++ b/test/jalview/io/gff/GffTests.java @@ -33,11 +33,13 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -47,6 +49,14 @@ import org.testng.annotations.Test; */ public class GffTests { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test the case where we load a protein ('query') sequence, then exonerateGff * describing its mapping to cDNA, and then a DNA sequence including the diff --git a/test/jalview/io/gff/InterProScanHelperTest.java b/test/jalview/io/gff/InterProScanHelperTest.java index 75546fb..bcccf35 100644 --- a/test/jalview/io/gff/InterProScanHelperTest.java +++ b/test/jalview/io/gff/InterProScanHelperTest.java @@ -31,17 +31,26 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceDummy; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class InterProScanHelperTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test processing one InterProScan GFF line * diff --git a/test/jalview/schemes/DnaCodonTests.java b/test/jalview/schemes/DnaCodonTests.java index 45b56c2..908d07b 100644 --- a/test/jalview/schemes/DnaCodonTests.java +++ b/test/jalview/schemes/DnaCodonTests.java @@ -22,13 +22,23 @@ package jalview.schemes; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class DnaCodonTests { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testAmbiguityCodeGeneration() { diff --git a/test/jalview/schemes/FeatureColourTest.java b/test/jalview/schemes/FeatureColourTest.java index fd49971..47613a1 100644 --- a/test/jalview/schemes/FeatureColourTest.java +++ b/test/jalview/schemes/FeatureColourTest.java @@ -26,14 +26,24 @@ import static org.testng.AssertJUnit.assertTrue; import static org.testng.AssertJUnit.fail; import jalview.datamodel.SequenceFeature; +import jalview.gui.JvOptionPane; import jalview.util.Format; import java.awt.Color; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FeatureColourTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testCopyConstructor() { diff --git a/test/jalview/schemes/ResidueColourSchemeTest.java b/test/jalview/schemes/ResidueColourSchemeTest.java index c7c558d..12a5491 100644 --- a/test/jalview/schemes/ResidueColourSchemeTest.java +++ b/test/jalview/schemes/ResidueColourSchemeTest.java @@ -7,13 +7,23 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.Profile; import jalview.datamodel.ProfileI; import jalview.datamodel.Profiles; +import jalview.gui.JvOptionPane; import java.awt.Color; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ResidueColourSchemeTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAboveThreshold() { diff --git a/test/jalview/schemes/ResiduePropertiesTest.java b/test/jalview/schemes/ResiduePropertiesTest.java index be6a10c..7fbad50 100644 --- a/test/jalview/schemes/ResiduePropertiesTest.java +++ b/test/jalview/schemes/ResiduePropertiesTest.java @@ -23,15 +23,25 @@ package jalview.schemes; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; +import jalview.gui.JvOptionPane; + import java.util.Collections; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ResiduePropertiesTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test 'standard' codon translations (no ambiguity codes) */ diff --git a/test/jalview/schemes/ScoreMatrixPrinter.java b/test/jalview/schemes/ScoreMatrixPrinter.java index 293690b..a743163 100644 --- a/test/jalview/schemes/ScoreMatrixPrinter.java +++ b/test/jalview/schemes/ScoreMatrixPrinter.java @@ -21,13 +21,23 @@ package jalview.schemes; import jalview.api.analysis.ScoreModelI; +import jalview.gui.JvOptionPane; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ScoreMatrixPrinter { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void printAllMatrices() { diff --git a/test/jalview/schemes/UserColourSchemeTest.java b/test/jalview/schemes/UserColourSchemeTest.java index 34af086..645d5b8 100644 --- a/test/jalview/schemes/UserColourSchemeTest.java +++ b/test/jalview/schemes/UserColourSchemeTest.java @@ -24,13 +24,23 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; +import jalview.gui.JvOptionPane; + import java.awt.Color; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class UserColourSchemeTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testGetColourFromString() { diff --git a/test/jalview/structure/Mapping.java b/test/jalview/structure/Mapping.java index 9ec3a92..5317a2d 100644 --- a/test/jalview/structure/Mapping.java +++ b/test/jalview/structure/Mapping.java @@ -28,17 +28,26 @@ import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import jalview.io.FileLoader; import jalview.io.FormatAdapter; import jalview.io.StructureFile; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class Mapping { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /* * more test data * diff --git a/test/jalview/structure/StructureSelectionManagerTest.java b/test/jalview/structure/StructureSelectionManagerTest.java index 2074fb4..1ccf6f6 100644 --- a/test/jalview/structure/StructureSelectionManagerTest.java +++ b/test/jalview/structure/StructureSelectionManagerTest.java @@ -27,6 +27,7 @@ import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.FormatAdapter; import jalview.io.StructureFile; import jalview.util.MapList; @@ -34,11 +35,20 @@ import jalview.util.MapList; import java.util.ArrayList; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class StructureSelectionManagerTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private StructureSelectionManager ssm; @BeforeMethod(alwaysRun = true) diff --git a/test/jalview/structures/models/AAStructureBindingModelTest.java b/test/jalview/structures/models/AAStructureBindingModelTest.java index 66e0152..84df512 100644 --- a/test/jalview/structures/models/AAStructureBindingModelTest.java +++ b/test/jalview/structures/models/AAStructureBindingModelTest.java @@ -30,6 +30,7 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.PDBEntry.Type; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.structure.AtomSpec; import jalview.structure.StructureSelectionManager; @@ -38,6 +39,7 @@ import jalview.structures.models.AAStructureBindingModel.SuperposeData; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -49,6 +51,14 @@ import org.testng.annotations.Test; */ public class AAStructureBindingModelTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /* * Scenario: Jalview has 4 sequences, corresponding to 1YCS (chains A and B), 3A6S|B, 1OOT|A */ diff --git a/test/jalview/util/ArrayUtilsTest.java b/test/jalview/util/ArrayUtilsTest.java index 30cc07d..743b9a3 100644 --- a/test/jalview/util/ArrayUtilsTest.java +++ b/test/jalview/util/ArrayUtilsTest.java @@ -22,12 +22,23 @@ package jalview.util; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + import java.util.Arrays; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ArrayUtilsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testReverseIntArray() { diff --git a/test/jalview/util/CaseInsensitiveStringTest.java b/test/jalview/util/CaseInsensitiveStringTest.java index 0429cce..093428c 100644 --- a/test/jalview/util/CaseInsensitiveStringTest.java +++ b/test/jalview/util/CaseInsensitiveStringTest.java @@ -25,10 +25,21 @@ import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class CaseInsensitiveStringTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testEquals() { diff --git a/test/jalview/util/ColorUtilsTest.java b/test/jalview/util/ColorUtilsTest.java index 77a023f..9a5d093 100644 --- a/test/jalview/util/ColorUtilsTest.java +++ b/test/jalview/util/ColorUtilsTest.java @@ -24,13 +24,23 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; +import jalview.gui.JvOptionPane; + import java.awt.Color; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ColorUtilsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Color paleColour = new Color(97, 203, 111); // pale green Color midColour = new Color(135, 57, 41); // mid red diff --git a/test/jalview/util/ComparisonTest.java b/test/jalview/util/ComparisonTest.java index b71c270..f955879 100644 --- a/test/jalview/util/ComparisonTest.java +++ b/test/jalview/util/ComparisonTest.java @@ -26,12 +26,21 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ComparisonTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testIsGap() { diff --git a/test/jalview/util/DBRefUtilsTest.java b/test/jalview/util/DBRefUtilsTest.java index 1c68a71..0ef3c25 100644 --- a/test/jalview/util/DBRefUtilsTest.java +++ b/test/jalview/util/DBRefUtilsTest.java @@ -32,14 +32,23 @@ import jalview.datamodel.Mapping; import jalview.datamodel.PDBEntry; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class DBRefUtilsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test the method that selects DBRefEntry items whose source is in a supplied * list diff --git a/test/jalview/util/DnaUtilsTest.java b/test/jalview/util/DnaUtilsTest.java index b9083f5..9815aa0 100644 --- a/test/jalview/util/DnaUtilsTest.java +++ b/test/jalview/util/DnaUtilsTest.java @@ -24,13 +24,24 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.fail; +import jalview.gui.JvOptionPane; + import java.text.ParseException; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class DnaUtilsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Tests for parsing an ENA/GenBank location specifier * diff --git a/test/jalview/util/FormatTest.java b/test/jalview/util/FormatTest.java index 2082963..24cb573 100644 --- a/test/jalview/util/FormatTest.java +++ b/test/jalview/util/FormatTest.java @@ -2,10 +2,21 @@ package jalview.util; import static org.testng.Assert.assertEquals; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class FormatTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAppendPercentage() { diff --git a/test/jalview/util/MapListTest.java b/test/jalview/util/MapListTest.java index 9a0bdd7..a2f38e2 100644 --- a/test/jalview/util/MapListTest.java +++ b/test/jalview/util/MapListTest.java @@ -27,15 +27,25 @@ import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; +import jalview.gui.JvOptionPane; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class MapListTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testSomething() { diff --git a/test/jalview/util/MappingUtilsTest.java b/test/jalview/util/MappingUtilsTest.java index 6d04661..417c2f6 100644 --- a/test/jalview/util/MappingUtilsTest.java +++ b/test/jalview/util/MappingUtilsTest.java @@ -39,6 +39,7 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignViewport; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.io.FormatAdapter; @@ -48,10 +49,19 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class MappingUtilsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private AlignViewportI dnaView; private AlignViewportI proteinView; diff --git a/test/jalview/util/ParseHtmlBodyAndLinksTest.java b/test/jalview/util/ParseHtmlBodyAndLinksTest.java index 2d5b4b3..bfaa7af 100644 --- a/test/jalview/util/ParseHtmlBodyAndLinksTest.java +++ b/test/jalview/util/ParseHtmlBodyAndLinksTest.java @@ -22,10 +22,21 @@ package jalview.util; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ParseHtmlBodyAndLinksTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testParseHtml_noLinks() { diff --git a/test/jalview/util/PlatformTest.java b/test/jalview/util/PlatformTest.java index 88fd1b9..1f7db54 100644 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@ -3,14 +3,25 @@ package jalview.util; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; +import jalview.gui.JvOptionPane; + import java.awt.Button; import java.awt.Event; import java.awt.event.MouseEvent; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class PlatformTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Button b = new Button(); /** diff --git a/test/jalview/util/QuickSortTest.java b/test/jalview/util/QuickSortTest.java index f976955..f09dee9 100644 --- a/test/jalview/util/QuickSortTest.java +++ b/test/jalview/util/QuickSortTest.java @@ -23,13 +23,24 @@ package jalview.util; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.util.Arrays; import java.util.Random; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class QuickSortTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static final String c1 = "Blue"; private static final String c2 = "Yellow"; diff --git a/test/jalview/util/ShiftListTest.java b/test/jalview/util/ShiftListTest.java index 62ddfb0..e8b9b50 100644 --- a/test/jalview/util/ShiftListTest.java +++ b/test/jalview/util/ShiftListTest.java @@ -23,14 +23,24 @@ package jalview.util; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; +import jalview.gui.JvOptionPane; + import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ShiftListTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testParseMap() { diff --git a/test/jalview/util/SparseCountTest.java b/test/jalview/util/SparseCountTest.java index c9a07a1..4c5b55b 100644 --- a/test/jalview/util/SparseCountTest.java +++ b/test/jalview/util/SparseCountTest.java @@ -4,9 +4,20 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SparseCountTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = "Functional") public void testAdd() { diff --git a/test/jalview/util/StringUtilsTest.java b/test/jalview/util/StringUtilsTest.java index 4dc44d4..b6f8a25 100644 --- a/test/jalview/util/StringUtilsTest.java +++ b/test/jalview/util/StringUtilsTest.java @@ -24,15 +24,25 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class StringUtilsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testInsertCharAt() { diff --git a/test/jalview/util/UrlLinkTest.java b/test/jalview/util/UrlLinkTest.java index f219fb8..d07206f 100644 --- a/test/jalview/util/UrlLinkTest.java +++ b/test/jalview/util/UrlLinkTest.java @@ -30,17 +30,26 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; import jalview.datamodel.Sequence; +import jalview.gui.JvOptionPane; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class UrlLinkTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + final static String DB = "Test"; final static String URL_PREFIX = "http://www.jalview.org/"; diff --git a/test/jalview/viewmodel/styles/ViewStyleTest.java b/test/jalview/viewmodel/styles/ViewStyleTest.java index 200cfbb..26c3574 100644 --- a/test/jalview/viewmodel/styles/ViewStyleTest.java +++ b/test/jalview/viewmodel/styles/ViewStyleTest.java @@ -24,16 +24,26 @@ import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.gui.JvOptionPane; + import java.awt.Color; import java.lang.reflect.Field; import java.util.Random; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class ViewStyleTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + Random r = new Random(); /** diff --git a/test/jalview/workers/AlignCalcManagerTest.java b/test/jalview/workers/AlignCalcManagerTest.java index acb9f33..9cc4fc2 100644 --- a/test/jalview/workers/AlignCalcManagerTest.java +++ b/test/jalview/workers/AlignCalcManagerTest.java @@ -34,15 +34,25 @@ import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import java.util.Collections; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class AlignCalcManagerTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private AlignFrame alignFrame; /** diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index 4b9437a..95863e7 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -25,18 +25,27 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.structure.StructureImportSettings; import jalview.structure.StructureImportSettings.StructureParser; import jalview.ws.seqfetcher.DbSourceProxy; import java.util.List; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class PDBSequenceFetcherTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + SequenceFetcher sf; @BeforeMethod(alwaysRun = true) diff --git a/test/jalview/ws/SequenceFetcherTest.java b/test/jalview/ws/SequenceFetcherTest.java index bc9f9a2..32afd5f 100644 --- a/test/jalview/ws/SequenceFetcherTest.java +++ b/test/jalview/ws/SequenceFetcherTest.java @@ -25,6 +25,7 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.ws.seqfetcher.ASequenceFetcher; import jalview.ws.seqfetcher.DbSourceProxy; @@ -32,9 +33,18 @@ import java.util.Enumeration; import java.util.List; import java.util.Vector; +import org.testng.annotations.BeforeClass; + public class SequenceFetcherTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * simple run method to test dbsources. * diff --git a/test/jalview/ws/dbsources/UniprotTest.java b/test/jalview/ws/dbsources/UniprotTest.java index 2df8be6..2f548d0 100644 --- a/test/jalview/ws/dbsources/UniprotTest.java +++ b/test/jalview/ws/dbsources/UniprotTest.java @@ -29,15 +29,25 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.datamodel.UniprotEntry; +import jalview.gui.JvOptionPane; import java.io.Reader; import java.io.StringReader; import java.util.Vector; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class UniprotTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + // adapted from http://www.uniprot.org/uniprot/A9CKP4.xml private static final String UNIPROT_XML = "" + "" diff --git a/test/jalview/ws/dbsources/XfamFetcherTest.java b/test/jalview/ws/dbsources/XfamFetcherTest.java index c894fd1..2f28484 100644 --- a/test/jalview/ws/dbsources/XfamFetcherTest.java +++ b/test/jalview/ws/dbsources/XfamFetcherTest.java @@ -21,12 +21,22 @@ package jalview.ws.dbsources; import jalview.datamodel.AlignmentI; +import jalview.gui.JvOptionPane; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class XfamFetcherTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "External" }) public void testRfamSeed() throws Exception { diff --git a/test/jalview/ws/ebi/EBIFetchClientTest.java b/test/jalview/ws/ebi/EBIFetchClientTest.java index e323a0d..40737ca 100644 --- a/test/jalview/ws/ebi/EBIFetchClientTest.java +++ b/test/jalview/ws/ebi/EBIFetchClientTest.java @@ -23,10 +23,21 @@ package jalview.ws.ebi; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; +import jalview.gui.JvOptionPane; + +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class EBIFetchClientTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Test method that constructs URL to fetch from */ diff --git a/test/jalview/ws/gui/Jws2ParamView.java b/test/jalview/ws/gui/Jws2ParamView.java index d672ab6..80b48c3 100644 --- a/test/jalview/ws/gui/Jws2ParamView.java +++ b/test/jalview/ws/gui/Jws2ParamView.java @@ -21,6 +21,7 @@ package jalview.ws.gui; import jalview.bin.Cache; +import jalview.gui.JvOptionPane; import jalview.gui.WsJobParameters; import jalview.util.MessageManager; import jalview.ws.jabaws.JalviewJabawsTestUtils; @@ -46,6 +47,14 @@ import compbio.metadata.PresetManager; public class Jws2ParamView { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * which services to test */ diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index 2067659..94a5fe0 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -26,6 +26,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import jalview.gui.JvOptionPane; import jalview.io.AnnotationFile; import jalview.io.FormatAdapter; import jalview.io.StockholmFileTest; @@ -44,6 +45,14 @@ import org.testng.annotations.Test; @Test(groups = { "External" }) public class DisorderAnnotExportImport { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static String testseqs = "examples/uniref50.fa"; public static Jws2Discoverer disc; diff --git a/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java b/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java index 4414782..12f5e1b 100644 --- a/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java +++ b/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java @@ -20,6 +20,7 @@ */ package jalview.ws.jabaws; +import jalview.gui.JvOptionPane; import jalview.ws.jws2.Jws2Discoverer; import java.util.Vector; @@ -33,6 +34,13 @@ public class JalviewJabawsTestUtils { @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { } diff --git a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java index 7f94b6b..22cdd4c 100644 --- a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java +++ b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java @@ -26,6 +26,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; import jalview.gui.Jalview2XML; +import jalview.gui.JvOptionPane; import jalview.io.AnnotationFile; import jalview.io.FormatAdapter; import jalview.io.StockholmFileTest; @@ -53,6 +54,14 @@ import compbio.metadata.WrongParameterException; public class JpredJabaStructExportImport { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static String testseqs = "examples/uniref50.fa"; public static Jws2Discoverer disc; diff --git a/test/jalview/ws/jabaws/MinJabawsClientTests.java b/test/jalview/ws/jabaws/MinJabawsClientTests.java index 53ab8d9..998524a 100644 --- a/test/jalview/ws/jabaws/MinJabawsClientTests.java +++ b/test/jalview/ws/jabaws/MinJabawsClientTests.java @@ -22,10 +22,13 @@ package jalview.ws.jabaws; import static org.testng.AssertJUnit.assertEquals; +import jalview.gui.JvOptionPane; + import java.util.ArrayList; import java.util.List; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import compbio.data.msa.MsaWS; @@ -38,6 +41,13 @@ import compbio.ws.client.Services; public class MinJabawsClientTests { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * simple test for the benefit of JAL-1338 * diff --git a/test/jalview/ws/jabaws/RNAStructExportImport.java b/test/jalview/ws/jabaws/RNAStructExportImport.java index 7bb6bdd..418e827 100644 --- a/test/jalview/ws/jabaws/RNAStructExportImport.java +++ b/test/jalview/ws/jabaws/RNAStructExportImport.java @@ -27,6 +27,7 @@ import jalview.bin.Cache; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.gui.Jalview2XML; +import jalview.gui.JvOptionPane; import jalview.io.AnnotationFile; import jalview.io.FileLoader; import jalview.io.FormatAdapter; @@ -55,6 +56,14 @@ import compbio.metadata.WrongParameterException; public class RNAStructExportImport { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + private static final String JAR_FILE_NAME = "testRnalifold_param.jar"; public static String testseqs = "examples/RF00031_folded.stk"; diff --git a/test/jalview/ws/jws2/ParameterUtilsTest.java b/test/jalview/ws/jws2/ParameterUtilsTest.java index 1e02213..0662e5b 100644 --- a/test/jalview/ws/jws2/ParameterUtilsTest.java +++ b/test/jalview/ws/jws2/ParameterUtilsTest.java @@ -25,6 +25,7 @@ import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; +import jalview.gui.JvOptionPane; import jalview.ws.jabaws.JalviewJabawsTestUtils; import jalview.ws.jws2.jabaws2.Jws2Instance; @@ -43,6 +44,14 @@ import compbio.metadata.WrongParameterException; public class ParameterUtilsTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /* * To limit tests to specify services, add them to this list; leave list empty * to test all diff --git a/test/jalview/ws/rest/RestClientTest.java b/test/jalview/ws/rest/RestClientTest.java index 12556b3..7a9419a 100644 --- a/test/jalview/ws/rest/RestClientTest.java +++ b/test/jalview/ws/rest/RestClientTest.java @@ -23,13 +23,23 @@ package jalview.ws.rest; import static org.testng.AssertJUnit.assertEquals; import jalview.bin.Cache; +import jalview.gui.JvOptionPane; import java.util.Vector; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class RestClientTest { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * Refactored 'as is' from main method */ diff --git a/test/jalview/ws/rest/ShmmrRSBSService.java b/test/jalview/ws/rest/ShmmrRSBSService.java index 30383f7..53341d0 100644 --- a/test/jalview/ws/rest/ShmmrRSBSService.java +++ b/test/jalview/ws/rest/ShmmrRSBSService.java @@ -24,9 +24,11 @@ import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; import java.util.Map; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** @@ -36,6 +38,13 @@ import org.testng.annotations.Test; public class ShmmrRSBSService { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testShmmrService() { diff --git a/test/jalview/ws/seqfetcher/DasSequenceFetcher.java b/test/jalview/ws/seqfetcher/DasSequenceFetcher.java index 3a011df..98ca303 100644 --- a/test/jalview/ws/seqfetcher/DasSequenceFetcher.java +++ b/test/jalview/ws/seqfetcher/DasSequenceFetcher.java @@ -20,12 +20,22 @@ */ package jalview.ws.seqfetcher; +import jalview.gui.JvOptionPane; + import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class DasSequenceFetcher { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testDasRegistryContact() { diff --git a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java index 0a565bd..e35f83e 100644 --- a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java +++ b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java @@ -31,6 +31,7 @@ import jalview.datamodel.DBRefSource; import jalview.datamodel.FeatureProperties; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.util.DBRefUtils; import jalview.ws.SequenceFetcher; import jalview.ws.dbsources.Pdb; @@ -51,6 +52,13 @@ import org.testng.annotations.Test; public class DbRefFetcherTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /** * @throws java.lang.Exception */ diff --git a/test/jalview/ws/sifts/SiftsClientTest.java b/test/jalview/ws/sifts/SiftsClientTest.java index 3f67c4c..f71c20d 100644 --- a/test/jalview/ws/sifts/SiftsClientTest.java +++ b/test/jalview/ws/sifts/SiftsClientTest.java @@ -26,6 +26,7 @@ import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; import jalview.io.AppletFormatAdapter; import jalview.structure.StructureMapping; import jalview.xml.binding.sifts.Entry.Entity; @@ -38,6 +39,7 @@ import java.util.HashMap; import org.testng.Assert; import org.testng.FileAssert; import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -47,6 +49,13 @@ import MCview.PDBfile; public class SiftsClientTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System .getProperty("user.home") + File.separatorChar -- 1.7.10.2