JAL-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git] / test / jalview / bin / CommandLineOperations.java
index 991d856..b85536e 100644 (file)
@@ -48,8 +48,11 @@ public class CommandLineOperations
   private static class Worker extends Thread
   {
     private final Process process;
+
     private BufferedReader outputReader;
+
     private BufferedReader errorReader;
+
     private Integer exit;
 
     private Worker(Process process)
@@ -109,7 +112,6 @@ public class CommandLineOperations
     {
       BufferedReader outputReader = new BufferedReader(
               new InputStreamReader(ls2_proc.getInputStream()));
-
       BufferedReader errorReader = new BufferedReader(
               new InputStreamReader(ls2_proc.getErrorStream()));
       worker = new Worker(ls2_proc);
@@ -127,20 +129,19 @@ public class CommandLineOperations
     return worker;
   }
 
-  @BeforeTest
+  @BeforeTest(alwaysRun = true)
   public void initialize()
   {
     new CommandLineOperations();
   }
 
-  
-  @BeforeTest
+  @BeforeTest(alwaysRun = true)
   public void setUpForHeadlessCommandLineInputOperations()
           throws IOException
   {
     String cmds = "nodisplay -open examples/uniref50.fa -sortbytree -props FILE -colour zappo "
             + "-jabaws http://www.compbio.dundee.ac.uk/jabaws -nosortbytree -dasserver nickname=www.test.com "
-            + "-features uniref50_test_features -annotations uniref50_test_annot -tree uniref50_test_tree";
+            + "-features examples/testdata/plantfdx.features -annotations examples/testdata/plantfdx.annotations -tree examples/testdata/uniref50_test_tree";
     Worker worker = jalviewDesktopRunner(true, cmds, 9000);
     String ln = null;
     while ((ln = worker.getOutputReader().readLine()) != null)
@@ -150,7 +151,7 @@ public class CommandLineOperations
     }
   }
 
-  @BeforeTest
+  @BeforeTest(alwaysRun = true)
   public void setUpForCommandLineInputOperations() throws IOException
   {
     String cmds = "-open examples/uniref50.fa -noquestionnaire -nousagestats";
@@ -174,16 +175,16 @@ public class CommandLineOperations
     }
   }
 
-  @Test(groups =
-  { "Functional" }, dataProvider = "allInputOpearationsData")
+  @Test(groups = { "Functional" }, dataProvider = "allInputOpearationsData")
   public void testAllInputOperations(String expectedString,
           String failureMsg)
   {
     Assert.assertTrue(successfulCMDs.contains(expectedString), failureMsg);
   }
 
-  @Test(groups =
-  { "Functional" }, dataProvider = "headlessModeOutputOperationsData")
+  @Test(
+    groups = { "Functional" },
+    dataProvider = "headlessModeOutputOperationsData")
   public void testHeadlessModeOutputOperations(String harg, String type,
           String fileName, boolean withAWT, int expectedMinFileSize,
           int timeout)
@@ -209,12 +210,10 @@ public class CommandLineOperations
     new File(fileName).delete();
   }
 
-
   @DataProvider(name = "allInputOpearationsData")
   public Object[][] getHeadlessModeInputParams()
   {
-    return new Object[][]
-    {
+    return new Object[][] {
         // headless mode input operations
         { "CMD [-color zappo] executed successfully!",
             "Failed command : -color zappo" },
@@ -231,26 +230,27 @@ public class CommandLineOperations
             "Failed command : -nosortbytree" },
         { "CMD [-dasserver nickname=www.test.com] executed successfully!",
             "Failed command : -dasserver nickname=www.test.com" },
-        { "CMD [-features uniref50_test_features]  executed successfully!",
-            "Failed command : -features uniref50_test_features" },
-        { "CMD [-annotations uniref50_test_annot] executed successfully!",
-            "Failed command : -annotations uniref50_test_annot" },
-        { "CMD [-tree uniref50_test_tree] executed successfully!",
-            "Failed command : -tree uniref50_test_tree" },
+        {
+            "CMD [-features examples/testdata/plantfdx.features]  executed successfully!",
+            "Failed command : -features examples/testdata/plantfdx.features" },
+        {
+            "CMD [-annotations examples/testdata/plantfdx.annotations] executed successfully!",
+            "Failed command : -annotations examples/testdata/plantfdx.annotations" },
+        {
+            "CMD [-tree examples/testdata/uniref50_test_tree] executed successfully!",
+            "Failed command : -tree examples/testdata/uniref50_test_tree" },
         // non headless mode input operations
         { "CMD [-nousagestats] executed successfully!",
             "Failed command : -nousagestats" },
         { "CMD [-noquestionnaire] executed successfully!",
-            "Failed command : -noquestionnaire nickname=www.test.com" }
-    };
+            "Failed command : -noquestionnaire nickname=www.test.com" } };
 
   }
-   
+
   @DataProvider(name = "headlessModeOutputOperationsData")
   public static Object[][] getHeadlessModeOutputParams()
   {
-    return new Object[][]
-    {
+    return new Object[][] {
         { "nodisplay -open examples/uniref50.fa", " -eps",
             "test_uniref50_out.eps", true, 4096, 4000 },
         { "nodisplay -open examples/uniref50.fa", " -eps",
@@ -282,7 +282,6 @@ public class CommandLineOperations
         { "headless -open examples/uniref50.fa", " -blc",
             "test_uniref50_out.blc", true, 2096, 3000 },
         { "headless -open examples/uniref50.fa", " -jalview",
-            "test_uniref50_out.jvp", true, 2096, 3000 },
-    };
+            "test_uniref50_out.jvp", true, 2096, 3000 }, };
   }
 }