JAL-629 Change all stdout and stderr output to use Console.outPrintln and Console...
[jalview.git] / test / jalview / bin / CommandsTest.java
index 73a0241..fe40682 100644 (file)
@@ -50,11 +50,15 @@ public class CommandsTest
   {
     Desktop.closeDesktop();
   }
-  
-  public static void callJalviewMain(String[] args) {
-    if (Jalview.getInstance()!=null) {
+
+  public static void callJalviewMain(String[] args)
+  {
+    if (Jalview.getInstance() != null)
+    {
       Jalview.getInstance().doMain(args);
-    } else {
+    }
+    else
+    {
       Jalview.main(args);
     }
   }
@@ -121,7 +125,10 @@ public class CommandsTest
     }
   }
 
-  @Test(groups = {"Functional","testTask1"}, dataProvider = "structureImageOutputFiles")
+  @Test(
+    groups =
+    { "Functional", "testTask1" },
+    dataProvider = "structureImageOutputFiles")
   public void structureImageOutputTest(String cmdLine, String[] filenames)
           throws IOException
   {
@@ -164,28 +171,30 @@ public class CommandsTest
   {
     cleanupFiles(filenames);
     String[] args = (cmdLine + " --gui").split("\\s+");
-    try {
-    callJalviewMain(args);
-    Commands cmds = Jalview.getInstance().getCommands();
-    Assert.assertNotNull(cmds);
-    File lastFile = null;
-    for (String filename : filenames)
+    try
     {
-      File file = new File(filename);
-      Assert.assertTrue(file.exists(), "File '" + filename
-              + "' was not created by '" + cmdLine + "'");
-      Assert.assertTrue(file.isFile(), "File '" + filename
-              + "' is not a file from '" + cmdLine + "'");
-      Assert.assertTrue(Files.size(file.toPath()) > 0, "File '" + filename
-              + "' has no content from '" + cmdLine + "'");
-      // make sure the successive output files get bigger!
-      if (lastFile != null)
-        Assert.assertTrue(
-                Files.size(file.toPath()) > Files.size(lastFile.toPath()));
-    }
+      callJalviewMain(args);
+      Commands cmds = Jalview.getInstance().getCommands();
+      Assert.assertNotNull(cmds);
+      File lastFile = null;
+      for (String filename : filenames)
+      {
+        File file = new File(filename);
+        Assert.assertTrue(file.exists(), "File '" + filename
+                + "' was not created by '" + cmdLine + "'");
+        Assert.assertTrue(file.isFile(), "File '" + filename
+                + "' is not a file from '" + cmdLine + "'");
+        Assert.assertTrue(Files.size(file.toPath()) > 0, "File '" + filename
+                + "' has no content from '" + cmdLine + "'");
+        // make sure the successive output files get bigger!
+        if (lastFile != null)
+          Assert.assertTrue(Files.size(file.toPath()) > Files
+                  .size(lastFile.toPath()));
+      }
     } catch (Exception x)
     {
-      Assert.fail("Unexpected exception during argFilesGlobAndSubstitutions",
+      Assert.fail(
+              "Unexpected exception during argFilesGlobAndSubstitutions",
               x);
     } finally
     {
@@ -214,7 +223,6 @@ public class CommandsTest
             { testfiles + "/structureimage1.png",
                 testfiles + "/structureimage2.png",
                 testfiles + "/structureimage3.png" } },
-        /*
         { "--headless --noquit --open=./examples/test_fab41.result/sample.a2m "
                 + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
                 + "--structureimage=" + testfiles + "/structureimage1.png "
@@ -230,6 +238,7 @@ public class CommandsTest
             { testfiles + "/structureimage1.png",
                 testfiles + "/structureimage2.png",
                 testfiles + "/structureimage3.png" } },
+        /*
                 */
         //
     };