From 8397031503322c9abe3c0f87066a3bf3b4600656 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 16 Mar 2023 10:41:20 +0000 Subject: [PATCH] JAL-629 fixed a test failing when run without a Jalview.main() having been started in another task --- test/jalview/gui/FeatureSettingsTest.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/jalview/gui/FeatureSettingsTest.java b/test/jalview/gui/FeatureSettingsTest.java index f0b3aef..98c04b3 100644 --- a/test/jalview/gui/FeatureSettingsTest.java +++ b/test/jalview/gui/FeatureSettingsTest.java @@ -29,9 +29,13 @@ import java.io.File; import java.io.IOException; import java.util.HashMap; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import jalview.api.FeatureColourI; +import jalview.bin.Cache; +import jalview.bin.Jalview; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.datamodel.features.FeatureMatcher; @@ -46,6 +50,22 @@ import jalview.viewmodel.seqfeatures.FeatureRendererModel; public class FeatureSettingsTest { + @BeforeClass(alwaysRun = true) + public static void setUpBeforeClass() throws Exception + { + /* + * use read-only test properties file + */ + Cache.loadProperties("test/jalview/io/testProps.jvprops"); + Jalview.main(new String[] { "-nonews" }); + } + + @AfterMethod(alwaysRun = true) + public void tearDown() + { + Desktop.instance.closeAll_actionPerformed(null); + } + /** * Test a roundtrip of save and reload of feature colours and filters as XML * -- 1.7.10.2