JAL-629 shorter wait times for this test
[jalview.git] / test / jalview / bin / CommandsTest2.java
index 072d515..5fa9ba0 100644 (file)
@@ -26,7 +26,7 @@ public class CommandsTest2
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    Cache.loadProperties("test/jalview/bin/commandsTest.jvprops");
+    Cache.loadProperties("test/jalview/bin/commandsTest2.jvprops");
     Date oneHourFromNow = new Date(
             System.currentTimeMillis() + 3600 * 1000);
     Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
@@ -57,14 +57,24 @@ public class CommandsTest2
 
   @Test(
     groups =
-    { "Functional" },
-    dataProvider = "structureOpeningArgsParams")
+    { "Functional", "testTask1" },
+    dataProvider = "structureOpeningArgsParams",
+    singleThreaded = true)
   public void structureOpeningArgsTest(String cmdLine, int seqNum,
           int annNum, int viewerNum)
   {
     String[] args = cmdLine.split("\\s+");
 
     Jalview.main(args);
+    try
+    {
+      // sleep for slow build server to open annotations and viewer windows
+      Thread.sleep(seqNum * 50 + annNum * 50 + viewerNum * 500);
+    } catch (InterruptedException e)
+    {
+      e.printStackTrace();
+    }
+
     AlignFrame[] afs = Desktop.getAlignFrames();
     Assert.assertNotNull(afs);
     Assert.assertTrue(afs.length > 0);
@@ -88,6 +98,7 @@ public class CommandsTest2
 
     AlignmentAnnotation[] aas = al.getAlignmentAnnotation();
     int visibleAnn = 0;
+    int dcount = 0;
     for (AlignmentAnnotation aa : aas)
     {
       if (aa.visible)
@@ -99,14 +110,6 @@ public class CommandsTest2
 
     if (viewerNum > -1)
     {
-      try
-      {
-        // sleep for slow build server to open viewer window
-        Thread.sleep(2000);
-      } catch (InterruptedException e)
-      {
-        e.printStackTrace();
-      }
       List<StructureViewerBase> openViewers = Desktop.instance
               .getStructureViewers(ap, null);
       Assert.assertNotNull(openViewers);
@@ -175,8 +178,10 @@ public class CommandsTest2
                 + "--noannotations " + "--nossannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 0, 1 },
-        { "--argfile=test/jalview/bin/commandsTest2.argfile1 ", 16, 19, 3 },
-        { "--argfile=test/jalview/bin/commandsTest2.argfile2 ", 16, 0, 2 },
+        { "--nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile1 ",
+            16, 19, 3 },
+        { "--nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile2 ",
+            16, 0, 2 },
         //
     };
   }