Merge branch 'features/JAL-1759jmolUpdate' into develop
authorJim Procter <jprocter@issues.jalview.org>
Thu, 23 Jul 2015 18:03:21 +0000 (19:03 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 23 Jul 2015 18:03:21 +0000 (19:03 +0100)
updates from revisions due to JAL-1805

1  2 
src/jalview/gui/Jalview2XML.java
test/MCview/PDBChainTest.java
test/jalview/bin/CommandLineOperations.java

Simple merge
@@@ -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");
@@@ -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 + "]");