From: Ben Soares Date: Thu, 16 Mar 2023 10:41:20 +0000 (+0000) Subject: JAL-629 fixed a test failing when run without a Jalview.main() having been started... X-Git-Tag: Release_2_11_4_0~445^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8397031503322c9abe3c0f87066a3bf3b4600656;p=jalview.git JAL-629 fixed a test failing when run without a Jalview.main() having been started in another task --- 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 *