From: Jim Procter Date: Thu, 23 Jul 2015 18:03:21 +0000 (+0100) Subject: Merge branch 'features/JAL-1759jmolUpdate' into develop X-Git-Tag: Release_2_10_0~562 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5247711ab4a6453614e2a9fb9307e6bae6a7b4a9;p=jalview.git Merge branch 'features/JAL-1759jmolUpdate' into develop updates from revisions due to JAL-1805 --- 5247711ab4a6453614e2a9fb9307e6bae6a7b4a9 diff --cc test/MCview/PDBChainTest.java index fda4e1b,da49f22..b84ca28 --- a/test/MCview/PDBChainTest.java +++ b/test/MCview/PDBChainTest.java @@@ -31,7 -31,7 +31,7 @@@ public class PDBChainTes final Atom a4 = new Atom(2f, 1f, 7f); - @BeforeMethod(alwaysRun = true) - @BeforeMethod ++ @BeforeMethod(alwaysRun = true) public void setUp() { System.out.println("setup"); diff --cc test/jalview/bin/CommandLineOperations.java index adc24db,3582dc5..09650ea --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@@ -132,65 -114,25 +132,64 @@@ public class CommandLineOperation 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 + "]");