JAL-4217 move CommandsTest to testTask3 involving structure image export and random...
[jalview.git] / test / jalview / bin / CommandsTest2.java
index 34966ae..ae14c1a 100644 (file)
@@ -51,13 +51,12 @@ public class CommandsTest2
   @AfterMethod(alwaysRun = true)
   public void tearDown()
   {
-    if (Desktop.instance != null)
-      Desktop.instance.closeAll_actionPerformed(null);
+    Desktop.closeDesktop();
   }
 
   @Test(
     groups =
-    { "Functional" },
+    { "Functional", "testTask1" },
     dataProvider = "structureOpeningArgsParams",
     singleThreaded = true)
   public void structureOpeningArgsTest(String cmdLine, int seqNum,
@@ -65,15 +64,20 @@ public class CommandsTest2
   {
     String[] args = cmdLine.split("\\s+");
 
-    Jalview.main(args);
-    try
+    CommandsTest.callJalviewMain(args);
+    while (Desktop.instance != null
+            && Desktop.instance.operationsAreInProgress())
     {
-      // sleep for slow build server to open annotations and viewer windows
-      Thread.sleep(seqNum * 100 + annNum * 200 + viewerNum * 1500);
-    } catch (InterruptedException e)
-    {
-      e.printStackTrace();
+      try
+      {
+        // sleep for slow build server to open annotations and viewer windows
+        Thread.sleep(viewerNum * 50);
+      } catch (InterruptedException e)
+      {
+        e.printStackTrace();
+      }
     }
+    ;
 
     AlignFrame[] afs = Desktop.getAlignFrames();
     Assert.assertNotNull(afs);
@@ -101,8 +105,6 @@ public class CommandsTest2
     int dcount = 0;
     for (AlignmentAnnotation aa : aas)
     {
-      System.err.println("##### DIAGNOSIS: annotation " + ++dcount
-              + " is labelled '" + aa.label + "'");
       if (aa.visible)
         visibleAnn++;
     }
@@ -133,55 +135,78 @@ public class CommandsTest2
       String cmdLine,
       int seqNum,
       int annNum,
-      int viewerNum,
-      String propsFile
+      int structureViewerNum,
      */
     return new Object[][] {
         //
         /*
          */
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
-                + "--colour=gecos:flower "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
+                + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 7, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
-                + "--colour=gecos:flower "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
+                + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--props=test/jalview/bin/commandsTest2.jvprops2 ",
             15, 4, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
-                + "--colour=gecos:flower "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
+                + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
-                + "--nossannotations "
+                + "--noshowssannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 4, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
-                + "--colour=gecos:flower "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
+                + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
-                + "--noannotations "
+                + "--noshowannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 3, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
-                + "--colour=gecos:flower "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
+                + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
-                + "--noannotations " + "--nossannotations "
+                + "--noshowannotations " + "--noshowssannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 0, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
-                + "--colour=gecos:flower "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
+                + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
-                + "--noannotations " + "--nossannotations "
+                + "--noshowannotations " + "--noshowssannotations "
                 + "--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 },
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile1 ",
+            16, 19, 3 },
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile2 ",
+            16, 0, 2 },
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
+                + "--allstructures "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--structureviewer=none "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_2_model_4.pdb "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_3_model_2.pdb",
+            16, 10, 0 },
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
+                + "--allstructures "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--noallstructures " + "--structureviewer=none "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_2_model_4.pdb "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_3_model_2.pdb",
+            16, 10, 2 },
+        /*
+         */
         //
     };
   }