JAL-629 real life test for --allframes
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 1 May 2023 00:36:51 +0000 (01:36 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 1 May 2023 00:36:51 +0000 (01:36 +0100)
test/jalview/bin/CommandsTest.java

index 2d3724b..57c4d0d 100644 (file)
@@ -14,6 +14,7 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+import jalview.bin.argparser.Arg;
 import jalview.gui.AlignFrame;
 import jalview.gui.Desktop;
 import jalview.gui.JvOptionPane;
@@ -219,4 +220,40 @@ public class CommandsTest
     }
   }
 
+  @Test(groups = "Functional", dataProvider = "allLinkedIdsData")
+  public void allLinkedIdsTest(String cmdLine, Arg a, String[] filenames)
+  {
+    String[] args = cmdLine.split("\\s+");
+    Jalview.main(args);
+    Commands cmds = Jalview.getInstance().getCommands();
+    Assert.assertNotNull(cmds);
+    for (String filename : filenames)
+    {
+      Assert.assertTrue(new File(filename).exists(),
+              "File '" + filename + "' was not created");
+    }
+    cleanupFiles(filenames);
+  }
+
+  @DataProvider(name = "allLinkedIdsData")
+  public Object[][] allLinkedIdsData()
+  {
+    return new Object[][] {
+        //
+        /*
+        { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --allframes --output={dirname}/{basename}.stk --close",
+            Arg.OUTPUT, new String[]
+            { "test/jalview/bin/argparser/testfiles/test1.stk",
+                "test/jalview/bin/argparser/testfiles/test2.stk",
+                "test/jalview/bin/argparser/testfiles/test3.stk", } },
+        */
+        { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --allframes --image={dirname}/{basename}.png --close",
+            Arg.IMAGE, new String[]
+            { "test/jalview/bin/argparser/testfiles/test1.png",
+                "test/jalview/bin/argparser/testfiles/test2.png",
+                "test/jalview/bin/argparser/testfiles/test3.png", } },
+        //
+    };
+  }
+
 }