From 5b217db18a75f420b915c6d467a5e823e1b07338 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 17 Mar 2023 14:49:19 +0100 Subject: [PATCH] JAL-4146 Fix SeqCanvasTest setup --- test/jalview/gui/SeqCanvasTest.java | 47 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/test/jalview/gui/SeqCanvasTest.java b/test/jalview/gui/SeqCanvasTest.java index 0efd4c9..c6630d4 100644 --- a/test/jalview/gui/SeqCanvasTest.java +++ b/test/jalview/gui/SeqCanvasTest.java @@ -30,6 +30,7 @@ import java.awt.Font; import java.awt.FontMetrics; import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import jalview.bin.Cache; @@ -48,30 +49,34 @@ public class SeqCanvasTest @BeforeClass(alwaysRun = true) public void setUp() { - // 2.11.2 - beforeMethod setup - // Cache.loadProperties("test/jalview/io/testProps.jvprops"); - //Cache.applicationProperties.setProperty("SHOW_IDENTITY", - // Boolean.TRUE.toString()); - // af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa", - // DataSourceType.FILE); - // /* - // * wait for Consensus thread to complete - // */ - // do - // { - //try - //{ - // Thread.sleep(50); - //} catch (InterruptedException x) - //{ - //} - // } while (af.getViewport().getCalcManager().isWorking()); - Cache.loadProperties(null); Desktop.getInstance().setVisible(false); } private AlignFrame af; + + + @BeforeMethod(alwaysRun = true) + public void setUpMethod() + { + Cache.loadProperties("test/jalview/io/testProps.jvprops"); + Cache.setOrRemove("SHOW_IDENTITY", Boolean.TRUE.toString()); + af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa", + DataSourceType.FILE); + + /* + * wait for Consensus thread to complete + */ + do + { + try + { + Thread.sleep(50); + } catch (InterruptedException x) + { + } + } while (af.getViewport().getCalcManager().isWorking()); + } /** * Test the method that computes wrapped width in residues, height of wrapped @@ -375,8 +380,8 @@ public class SeqCanvasTest @Test(groups = "Functional") public void testClear_HighlightAndSelection() { - AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( - "examples/uniref50.fa", DataSourceType.FILE); +// AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( +// "examples/uniref50.fa", DataSourceType.FILE); AlignViewport av = af.getViewport(); SearchResultsI highlight = new SearchResults(); highlight.addResult( -- 1.7.10.2