new CommandLineOperations();
}
-
- @Test(groups =
- { "Functional" }, dataProvider = "headlessModeOutputParams")
- public void testHeadlessModeOutputs(String harg, String type,
- String fileName, boolean withAWT, int expectedMinFileSize)
+ @BeforeTest(alwaysRun = true)
+ public void setUpForHeadlessCommandLineInputOperations()
+ throws IOException
{
- String cmd = harg + type + " " + fileName;
- // System.out.println(">>>>>>>>>>>>>>>> Command : " + cmd);
- File file = new File(fileName);
- Worker worker = null;
- try
+ 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 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)
{
- worker = jalviewDesktopRunner(withAWT, cmd, 9000);
- } catch (InterruptedException e)
+ System.out.println(ln);
+ successfulCMDs.add(ln);
+ }
+ }
+
+ @BeforeTest(alwaysRun = true)
+ public void setUpForCommandLineInputOperations() throws IOException
+ {
+ String cmds = "-open examples/uniref50.fa -noquestionnaire -nousagestats";
+ Worker worker = jalviewDesktopRunner(false, cmds, 9000);
+ String ln = null;
+ int count = 0;
+ while ((ln = worker.getErrorReader().readLine()) != null)
{
- e.printStackTrace();
- } catch (IOException e)
+ System.out.println(ln);
+ successfulCMDs.add(ln);
+ if (++count > 5)
+ {
+ break;
+ }
+ }
+ if (worker != null && worker.exit == null)
{
- e.printStackTrace();
+ worker.interrupt();
+ Thread.currentThread().interrupt();
+ worker.process.destroy();
}
+ }
+
+ @Test(groups =
+ { "Functional" }, dataProvider = "allInputOpearationsData")
+ public void testAllInputOperations(String expectedString,
+ String failureMsg)
+ {
+ Assert.assertTrue(successfulCMDs.contains(expectedString), failureMsg);
+ }
+
+ @Test(groups =
+ { "Functional" }, dataProvider = "headlessModeOutputOperationsData")
+ public void testHeadlessModeOutputOperations(String harg, String type,
+ String fileName, boolean withAWT, int expectedMinFileSize,
+ int timeout)
+ {
+ String cmd = harg + type + " " + fileName;
+ // System.out.println(">>>>>>>>>>>>>>>> Command : " + cmd);
+ File file = new File(fileName);
+ Worker worker = jalviewDesktopRunner(withAWT, cmd, timeout);
FileAssert.assertFile(file, "Didn't create an output" + type
+ " file.[" + harg + "]");