Merge branch 'develop' into update_212_Dec_merge_with_21125_chamges
[jalview.git] / test / jalview / gui / SeqCanvasTest.java
index 98f2433..0efd4c9 100644 (file)
@@ -29,16 +29,16 @@ import static org.testng.Assert.assertTrue;
 import java.awt.Font;
 import java.awt.FontMetrics;
 
-import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SearchResults;
 import jalview.datamodel.SearchResultsI;
 import jalview.io.DataSourceType;
 import jalview.io.FileLoader;
+
 import jalview.util.Platform;
 import jalview.viewmodel.ViewportRanges;
 import junit.extensions.PA;
@@ -48,11 +48,31 @@ 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);
-    Cache.initLogger();
     Desktop.getInstance().setVisible(false);
   }
 
+  private AlignFrame af;
+
   /**
    * Test the method that computes wrapped width in residues, height of wrapped
    * widths in pixels, and the number of widths visible
@@ -352,28 +372,6 @@ public class SeqCanvasTest
     assertEquals(repeatingHeight, charHeight * (2 + al.getHeight()));
   }
 
-  @BeforeMethod(alwaysRun = true)
-  public void 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());
-  }
   @Test(groups = "Functional")
   public void testClear_HighlightAndSelection()
   {