X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignFrameTest.java;fp=test%2Fjalview%2Fgui%2FAlignFrameTest.java;h=31bd21443e863a377a82a3521e54ab7b45efde87;hb=4898f0ae429e0c61ddba72ca46be89b34bb4df8b;hp=1a4920d719490bedf7497268f9a3e9c7a77582b3;hpb=5a6ac5b535856903629234ad43a71319a91ebee5;p=jalview.git diff --git a/test/jalview/gui/AlignFrameTest.java b/test/jalview/gui/AlignFrameTest.java index 1a4920d..31bd214 100644 --- a/test/jalview/gui/AlignFrameTest.java +++ b/test/jalview/gui/AlignFrameTest.java @@ -27,6 +27,14 @@ import static org.testng.Assert.assertNotSame; import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; +import java.awt.Color; +import java.util.Iterator; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.bin.Cache; @@ -51,14 +59,6 @@ import jalview.schemes.TurnColourScheme; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; -import java.awt.Color; -import java.util.Iterator; - -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - public class AlignFrameTest { AlignFrame af; @@ -77,7 +77,7 @@ public class AlignFrameTest @AfterMethod(alwaysRun = true) public void tearDown() { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); } /** @@ -88,7 +88,7 @@ public class AlignFrameTest public void setUp() { Cache.loadProperties("test/jalview/io/testProps.jvprops"); - Cache.applicationProperties.setProperty("SHOW_IDENTITY", + Cache.setPropertyNoSave("SHOW_IDENTITY", Boolean.TRUE.toString()); af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa", DataSourceType.FILE); @@ -96,18 +96,15 @@ public class AlignFrameTest /* * wait for Consensus thread to complete */ - synchronized (this) + do { - while (af.getViewport().getConsensusSeq() == null) + try + { + Thread.sleep(50); + } catch (InterruptedException x) { - try - { - wait(50); - } catch (InterruptedException e) - { - } } - } + } while (af.getViewport().getCalcManager().isWorking()); } public static void setUpJvOptionPane() @@ -360,7 +357,7 @@ public class AlignFrameTest /* * inspect the colour of - * FER_CAPAN.9(I), column 14 (14 base 0) + * FER_CAPAN.9(I), column 15 (14 base 0) * FER_CAPAN.10(SER), column 16 (15 base 0) */ SequenceI ferCapan = al.findName("FER_CAPAN"); @@ -379,10 +376,14 @@ public class AlignFrameTest SliderPanel sp = SliderPanel.getSliderPanel(); assertTrue(sp.isForConservation()); assertEquals(sp.getValue(), 30); // initial slider setting + c = rs.findColour('I', 14, ferCapan); + Color i_faded = new Color(255, 255, 255); + assertEquals(c, i_faded); sp.valueChanged(10); assertSame(rs, av.getResidueShading()); + assertEquals(rs.getConservationInc(), 10); c = rs.findColour('I', 14, ferCapan); - Color i_faded = new Color(196, 186, 196); + i_faded = new Color(196, 186, 196); assertEquals(c, i_faded); c = rs.findColour('S', 15, ferCapan); Color s_faded = new Color(144, 225, 144);