JAL-3446 AlignViewportTest
[jalview.git] / test / jalview / gui / AlignViewportTest.java
index 8a5ef8c..c2983ec 100644 (file)
@@ -35,6 +35,7 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import jalview.api.AlignCalcWorkerI;
 import jalview.bin.Cache;
 import jalview.bin.Jalview;
 import jalview.datamodel.AlignedCodonFrame;
@@ -55,6 +56,7 @@ import jalview.schemes.PIDColourScheme;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.MapList;
 import jalview.viewmodel.ViewportRanges;
+import jalview.workers.AlignCalcManager;
 
 public class AlignViewportTest
 {
@@ -73,7 +75,9 @@ public class AlignViewportTest
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    Jalview.main(new String[] { "-nonews", "-props",
+    Jalview.main(new String[] {
+        //"-jabaws", "none", 
+        "-nonews", "-props",
         "test/jalview/testProps.jvprops" });
 
     /*
@@ -319,15 +323,19 @@ public class AlignViewportTest
   {
     synchronized (this)
     {
-      while (viewport.getCalcManager().isWorking())
+      System.out.print("waiting...");
+      int n = 3;
+      while (--n >= 0 || viewport.getCalcManager().isWorking())
       {
         try
         {
+          System.out.print(((AlignCalcManager) viewport.getCalcManager()).getQueueLength());
           wait(50);
         } catch (InterruptedException e)
         {
         }
       }
+           System.out.println("...done");
     }
   }
 
@@ -478,7 +486,10 @@ public class AlignViewportTest
     AlignViewport testme = af.getViewport();
     waitForCalculations(testme);
     SequenceI cons = testme.getConsensusSeq();
-    assertEquals("A-C", cons.getSequenceAsString());
+    String s = cons.getSequenceAsString();
+    System.out.println("s is " + s);
+    
+    assertEquals("A-C", s);
   }
 
   @Test(groups = { "Functional" })