X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fbin%2FCommandsTest.java;h=e42cc5462d583dc928c3f69a5a828026d7b38796;hb=refs%2Fheads%2Fbug%2FJAL-4290_headless_alignment_figure_with_sse;hp=e4fea7b18c2803c24106f64735d3e8f371ac3e8a;hpb=5afaa80bd2cddc6651867f86a04affffa0896f89;p=jalview.git diff --git a/test/jalview/bin/CommandsTest.java b/test/jalview/bin/CommandsTest.java index e4fea7b..e42cc54 100644 --- a/test/jalview/bin/CommandsTest.java +++ b/test/jalview/bin/CommandsTest.java @@ -1,103 +1,750 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.bin; import java.io.File; import java.io.IOException; -import java.lang.management.ManagementFactory; +import java.lang.reflect.InvocationTargetException; +import java.nio.file.Files; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; -import org.testng.annotations.BeforeTest; +import javax.swing.SwingUtilities; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import io.github.classgraph.ClassGraph; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.JvOptionPane; +import jalview.util.ArrayUtils; public class CommandsTest { + private static final String testfiles = "test/jalview/bin/argparser/testfiles"; - private static final int SETUP_TIMEOUT = 30000; + @BeforeClass(alwaysRun = true) + public static void setUpBeforeClass() throws Exception + { + Cache.loadProperties("test/jalview/gui/quitProps.jvprops"); + Date oneHourFromNow = new Date( + System.currentTimeMillis() + 3600 * 1000); + Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow); + } - private static class Worker extends Thread + @AfterClass(alwaysRun = true) + public static void resetProps() { - private final Process process; + Cache.loadProperties("test/jalview/testProps.jvprops"); + } - private Integer exit; + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } - private Worker(Process process) + @AfterMethod(alwaysRun = true) + public void tearDown() + { + try + { + // occasionally we are blocked by Jmol redraws + SwingUtilities.invokeAndWait(new Runnable() + { + + @Override + public void run() + { + Desktop.closeDesktop(); + } + }); + } catch (Exception foo) { - this.process = process; + System.err.println("Failed during teardown with exception"); + foo.printStackTrace(); } - @Override - public void run() + } + + public static void callJalviewMain(String[] args) + { + if (Jalview.getInstance() != null) { - try - { - exit = process.waitFor(); - } catch (InterruptedException ignore) + Jalview.getInstance().doMain(args); + } + else + { + Jalview.main(args); + } + } + + /* --setprops is currently disabled so this test won't work + @Test(groups = "Functional") + public void setpropsTest() + { + final String MOSTLY_HARMLESS = "MOSTLY_HARMLESS"; + String cmdLine = "--setprop=" + MOSTLY_HARMLESS + "=Earth"; + String[] args = cmdLine.split("\\s+"); + Jalview.main(args); + Assert.assertEquals(Cache.getDefault(MOSTLY_HARMLESS, "Magrathea"), + "Earth"); + } + */ + + @Test(groups = { "Functional", "testTask3" }, dataProvider = "cmdLines", singleThreaded = true) + + public void commandsOpenTest(String cmdLine, boolean cmdArgs, + int numFrames, String[] sequences) + { + try + { + String[] args = (cmdLine + " --gui").split("\\s+"); + callJalviewMain(args); + Commands cmds = Jalview.getInstance().getCommands(); + Assert.assertNotNull(cmds); + Assert.assertEquals(cmds.commandArgsProvided(), cmdArgs, + "Commands were not provided in the args"); + Assert.assertEquals(cmds.argsWereParsed(), cmdArgs, + "Overall command parse and operation is false"); + + Assert.assertEquals(Desktop.getDesktopAlignFrames().length, numFrames, + "Wrong number of AlignFrames"); + + if (sequences != null) { - return; + Set openedSequenceNames = new HashSet<>(); + AlignFrame[] afs = Desktop.getDesktopAlignFrames(); + for (AlignFrame af : afs) + { + openedSequenceNames.addAll( + af.getViewport().getAlignment().getSequenceNames()); + } + for (String sequence : sequences) + { + Assert.assertTrue(openedSequenceNames.contains(sequence), + "Sequence '" + sequence + + "' was not found in opened alignment files: " + + cmdLine + ".\nOpened sequence names are:\n" + + String.join("\n", openedSequenceNames)); + } } + + Assert.assertFalse( + lookForSequenceName("THIS_SEQUENCE_ID_DOESN'T_EXIST")); + } catch (Exception x) + { + Assert.fail("Unexpected exception during commandsOpenTest", x); + } finally + { + tearDown(); + } } - private static ClassGraph scanner = null; - - private static String classpath = null; + @Test( + groups = + { "Functional", "testTask3" }, + dataProvider = "structureImageOutputFiles", singleThreaded = true) + public void structureImageOutputTest(String cmdLine, String[] filenames) + throws IOException + { + cleanupFiles(filenames); + String[] args = (cmdLine + " --gui").split("\\s+"); + try + { + callJalviewMain(args); + Commands cmds = Jalview.getInstance().getCommands(); + Assert.assertNotNull(cmds); + verifyIncreasingSize(cmdLine, filenames); + } catch (Exception x) + { + Assert.fail("Unexpected exception during structureImageOutputTest", + x); + } finally + { + cleanupFiles(filenames); + tearDown(); + } + } - private static String modules = null; + /** + * given two command lines, compare the output files produced - they should exist and be equal in size + */ + @Test( + groups = + { "Functional", "testTask3" }, + dataProvider = "compareHeadlessAndGUIOps", + singleThreaded = true) + public void headlessOrGuiImageOutputTest(String[] cmdLines, + String[] filenames) throws IOException + { + cleanupFiles(filenames); + try + { + for (String cmdLine : cmdLines) + { + CommandLineOperations.Worker runner = CommandLineOperations.getJalviewDesktopRunner(false, cmdLine, 1000); + long timeOut = 10000; + while (runner.isAlive() && timeOut>0) + { + Thread.sleep(25); + timeOut-=25; + } + } + verifyOrderedFileSet(cmdLines[0] + " vs " + cmdLines[1], filenames, + false); + } catch (Exception x) + { + Assert.fail("Unexpected exception during structureImageOutputTest", + x); + } finally + { + cleanupFiles(filenames); + tearDown(); + } + } + @DataProvider(name = "compareHeadlessAndGUIOps") + public Object[][] compareHeadlessAndGUIOps() + { + return new Object[][] { + new Object[] + { new String[] { "--open examples/uniref50.fa " + + "--structure [seqid=FER1_SPIOL,tempfac=plddt,showssannotations,structureviewer=jmol]" + + "examples/AlphaFold/AF-P00221-F1-model_v4.pdb " + + "--paematrix examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json --image=" + + testfiles + "test-al-pae-ss-gui.png --overwrite --gui --quit", + "--open examples/uniref50.fa " + + "--structure [seqid=FER1_SPIOL,tempfac=plddt,showssannotations,structureviewer=jmol]" + + "examples/AlphaFold/AF-P00221-F1-model_v4.pdb " + + "--paematrix examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json --image=" + + testfiles + + "test-al-pae-ss-nogui.png --overwrite --nogui" - private static String java_exe = null; + }, new String[] { + testfiles + "test-al-pae-ss-gui.png", + testfiles + + "test-al-pae-ss-nogui.png", + } } }; + } + + private static void verifyIncreasingSize(String cmdLine, String[] filenames) throws Exception + { + verifyOrderedFileSet(cmdLine, filenames, true); + } + + private static void verifyOrderedFileSet(String cmdLine, String[] filenames, boolean increasingSize) throws Exception + { + 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) + { + waitForLastWrite(file,25); + + if (increasingSize) + { Assert.assertTrue(Files.size(file.toPath()) > Files + .size(lastFile.toPath()),"Expected " + file.toPath()+ " to be larger than "+lastFile.toPath()); + } else { + Assert.assertEquals(Files.size(file.toPath()), Files + .size(lastFile.toPath()), "New file "+file.toPath()+" (actual size) not same as last file's size "+lastFile.toString()); + } + } + // remember it for next file + lastFile = file; + } - public synchronized static String getClassPath() + } + private static long waitForLastWrite(File file, int i) throws IOException { - java_exe = System.getProperty("java.home") + File.separator + "bin" - + File.separator + "java"; - classpath = ManagementFactory.getRuntimeMXBean().getClassPath(); - return classpath; + long lastSize,stableSize =Files.size(file.toPath()); + // wait around until we are sure the file has been completely written. + do { + lastSize = stableSize; + try { + Thread.sleep(i); + } catch (Exception x) {} + stableSize=Files.size(file.toPath()); + } while (stableSize!=lastSize); + return stableSize; } - private Worker getJalviewDesktopRunner(boolean withAwt, String cmd, - int timeout) + @Test(groups = "Functional", dataProvider = "argfileOutputFiles", singleThreaded = true) + + public void argFilesGlobAndSubstitutionsTest(String cmdLine, + String[] filenames) throws IOException { - // Note: JAL-3065 - don't include quotes for lib/* because the arguments are - // not expanded by the shell - String classpath = getClassPath(); - String _cmd = java_exe + " " - + (withAwt ? "-Djava.awt.headless=true" : "") + " -classpath " - + classpath + " jalview.bin.Jalview "; - Process ls2_proc = null; - Worker worker = null; + cleanupFiles(filenames); + String[] args = (cmdLine + " --gui").split("\\s+"); try { - ls2_proc = Runtime.getRuntime().exec(_cmd + cmd); - } catch (Throwable e1) + 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())); + System.out.println("this file: "+file+" +"+Files.size(file.toPath()) + " greater than " +Files.size(lastFile.toPath())); + } + // remember it for next file + lastFile = file; + } + } catch (Exception x) + { + Assert.fail( + "Unexpected exception during argFilesGlobAndSubstitutions", + x); + } finally { - e1.printStackTrace(); + cleanupFiles(filenames); + tearDown(); + } + } + + @DataProvider(name = "structureImageOutputFiles") + public Object[][] structureImageOutputFiles() + { + return new Object[][] { + // + { "--gui --nonews --nosplash --open=./examples/test_fab41.result/sample.a2m " + + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb " + + "--structureimage=" + testfiles + "/structureimage1.png " + + "--open=./examples/test_fab41.result/sample.a2m " + + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb " + + "--structureimage=" + testfiles + + "/structureimage2.png --scale=1.5 " + + "--open=./examples/test_fab41.result/sample.a2m " + + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb " + + "--structureimage=" + testfiles + + "/structureimage3.png --scale=2.0 ", + new String[] + { 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 " + + "--open=./examples/test_fab41.result/sample.a2m " + + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb " + + "--structureimage=" + testfiles + + "/structureimage2.png --scale=1.5 " + + "--open=./examples/test_fab41.result/sample.a2m " + + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb " + + "--structureimage=" + testfiles + + "/structureimage3.png --scale=2.0 ", + new String[] + { testfiles + "/structureimage1.png", + testfiles + "/structureimage2.png", + testfiles + "/structureimage3.png" } }, + { "--gui --nonews --nosplash --open examples/1gaq.txt --append ./examples/3W5V.pdb "+"--structure examples/1gaq.txt --seqid \"1GAQ|A\" "+"--structureimage "+testfiles+"/1gaq.png --structure examples/3W5V.pdb "+"--seqid \"3W5V|A\" --structureimage "+testfiles+"/3w5v.png --overwrite", + + new String[] { + testfiles+"/1gaq.png",testfiles+"/3w5v.png" + } + }, + { "--headless --noquit --open ./examples/1gaq.txt --append ./examples/3W5V.pdb "+"--structure examples/1gaq.txt --seqid \"1GAQ|A\" "+"--structureimage "+testfiles+"/1gaq.png --structure examples/3W5V.pdb "+"--seqid \"3W5V|A\" --structureimage "+testfiles+"/3w5v.png --overwrite", + + new String[] { + testfiles+"/1gaq.png",testfiles+"/3w5v.png" + } } - if (ls2_proc != null) + + /* + */ + // + }; + + } + + @DataProvider(name = "argfileOutputFiles") + public Object[][] argfileOutputFiles() + { + return new Object[][] { + // + { "--gui --argfile=" + testfiles + "/**/*.txt", new String[] + { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png", + testfiles + "/dir3/subdir/test0.png" } }, + { "--gui --argfile=" + testfiles + "/**/argfile.txt", new String[] + { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png" } }, + { "--gui --argfile=" + testfiles + "/dir*/argfile.txt", new String[] + { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png" } }, + { "--gui --initsubstitutions --append examples/uniref50.fa --image " + + testfiles + "/{basename}.png", + new String[] + { testfiles + "/uniref50.png" } }, + { "--gui --append examples/uniref50.fa --nosubstitutions --image " + + testfiles + "/{basename}.png", + new String[] + { testfiles + "/{basename}.png" } } + // + }; + + } + + @DataProvider(name = "cmdLines") + public Object[][] cmdLines() + { + String[] someUniref50Seqs = new String[] { "FER_CAPAA", "FER_CAPAN", + "FER1_MAIZE", "FER1_SPIOL", "O80429_MAIZE" }; + String[] t1 = new String[] { "TEST1" }; + String[] t2 = new String[] { "TEST2" }; + String[] t3 = new String[] { "TEST3" }; + return new Object[][] { + /* + */ + { "--append=examples/uniref50.fa", true, 1, someUniref50Seqs }, + { "--append examples/uniref50.fa", true, 1, someUniref50Seqs }, + { "--append=examples/uniref50*.fa", true, 1, someUniref50Seqs }, + // NOTE we cannot use shell expansion in tests, so list all files! + { "--append examples/uniref50.fa examples/uniref50_mz.fa", true, 1, + someUniref50Seqs }, + { "--append=[new]examples/uniref50*.fa", true, 2, + someUniref50Seqs }, + { "--open=examples/uniref50*.fa", true, 2, someUniref50Seqs }, + { "examples/uniref50.fa", true, 1, someUniref50Seqs }, + { "examples/uniref50.fa " + testfiles + "/test1.fa", true, 2, + ArrayUtils.concatArrays(someUniref50Seqs, t1) }, + { "examples/uniref50.fa " + testfiles + "/test1.fa", true, 2, t1 }, + { "--gui --argfile=" + testfiles + "/argfile0.txt", true, 1, + ArrayUtils.concatArrays(t1, t3) }, + { "--gui --argfile=" + testfiles + "/argfile*.txt", true, 5, + ArrayUtils.concatArrays(t1, t2, t3) }, + { "--gui --argfile=" + testfiles + "/argfile.autocounter", true, 3, + ArrayUtils.concatArrays(t1, t2) } }; + + } + + public static boolean lookForSequenceName(String sequenceName) + { + AlignFrame[] afs = Desktop.getDesktopAlignFrames(); + for (AlignFrame af : afs) { - worker = new Worker(ls2_proc); - worker.start(); - try + for (String name : af.getViewport().getAlignment().getSequenceNames()) { - worker.join(timeout); - } catch (InterruptedException e) + if (sequenceName.equals(name)) + { + return true; + } + } + } + return false; + } + + public static void cleanupFiles(String[] filenames) + { + for (String filename : filenames) + { + File file = new File(filename); + if (file.exists()) { - System.err.println("Thread interrupted"); + file.delete(); } } - return worker; } - @BeforeTest(alwaysRun = true) - public void initialize() + private final String deleteDir = "test/deleteAfter"; + + @Test( + groups = "Functional", + dataProvider = "allLinkedIdsData", + singleThreaded = true) + public void allLinkedIdsTest(String cmdLine, String[] filenames, + String[] nonfilenames) { - new CommandsTest(); + String[] args = (cmdLine + " --gui").split("\\s+"); + callJalviewMain(args); + Commands cmds = Jalview.getInstance().getCommands(); + Assert.assertNotNull(cmds); + for (String filename : filenames) + { + Assert.assertTrue(new File(filename).exists(), + "File '" + filename + "' was not created"); + } + cleanupFiles(filenames); + if (nonfilenames != null) + { + for (String nonfilename : nonfilenames) + { + File nonfile = new File(nonfilename); + Assert.assertFalse(nonfile.exists(), + "File " + nonfilename + " exists when it shouldn't!"); + } + } + + File deleteDirF = new File(deleteDir); + if (deleteDirF.exists()) + { + deleteDirF.delete(); + } } - @Test(groups = "Functional") - public void setUpForHeadlessCommandsTest() throws IOException + @DataProvider(name = "allLinkedIdsData") + public Object[][] allLinkedIdsData() { - String cmds = "--open=./examples/uniref50.fa"; - Worker worker = getJalviewDesktopRunner(true, cmds, SETUP_TIMEOUT); + return new Object[][] { + // + { "--gui --open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --output={dirname}/{basename}.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", }, + null }, + { "--gui --open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close", + new String[] + { "test/jalview/bin/argparser/testfiles/test1.png", + "test/jalview/bin/argparser/testfiles/test2.png", + "test/jalview/bin/argparser/testfiles/test3.png", }, + null }, + { "--gui --open=test/jalview/bin/argparser/testfiles/*.fa --all --output={dirname}/{basename}.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", }, + new String[] + { "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, }, + { "--gui --open=test/jalview/bin/argparser/**/*.fa --all --output={dirname}/{basename}.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, + null }, + { "--gui --open=test/jalview/bin/argparser/**/*.fa --output=*/*.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, + null }, + { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --all --output=*/*.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", }, + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, }, + { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=*/*.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", }, + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, }, + { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output={dirname}/{basename}.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", }, + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, }, + { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output={dirname}/{basename}.stk --close", + new String[] + { "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", }, + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, }, + { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --output {dirname}/{basename}.stk --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output={dirname}/{basename}.aln --close", + new String[] + { "test/jalview/bin/argparser/testfiles/dir1/test1.stk", + "test/jalview/bin/argparser/testfiles/dir1/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.aln", + "test/jalview/bin/argparser/testfiles/dir2/test2.aln", + "test/jalview/bin/argparser/testfiles/dir2/test3.aln", }, + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", + "test/jalview/bin/argparser/testfiles/test1.aln", + "test/jalview/bin/argparser/testfiles/test2.aln", + "test/jalview/bin/argparser/testfiles/test3.aln", + "test/jalview/bin/argparser/testfiles/dir1/test1.aln", + "test/jalview/bin/argparser/testfiles/dir1/test2.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.aln", }, }, + // --mkdirs + { "--headless --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --output " + + deleteDir + + "/{dirname}/{basename}.stk --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=" + + deleteDir + + "/{dirname}/{basename}.aln --close --all --mkdirs", + new String[] + { deleteDir + + "/test/jalview/bin/argparser/testfiles/dir1/test1.stk", + deleteDir + + "/test/jalview/bin/argparser/testfiles/dir1/test2.stk", + deleteDir + + "/test/jalview/bin/argparser/testfiles/dir2/test1.aln", + deleteDir + + "/test/jalview/bin/argparser/testfiles/dir2/test2.aln", + deleteDir + + "/test/jalview/bin/argparser/testfiles/dir2/test3.aln", }, + new String[] + { "test/jalview/bin/argparser/testfiles/test1.stk", + "test/jalview/bin/argparser/testfiles/test2.stk", + "test/jalview/bin/argparser/testfiles/test3.stk", + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", + "test/jalview/bin/argparser/testfiles/test1.aln", + "test/jalview/bin/argparser/testfiles/test2.aln", + "test/jalview/bin/argparser/testfiles/test3.aln", + "test/jalview/bin/argparser/testfiles/dir1/test1.aln", + "test/jalview/bin/argparser/testfiles/dir1/test2.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.aln", + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/test1.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/test2.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/test3.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir2/test1.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir2/test2.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir2/test3.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", + deleteDir + + "test/jalview/bin/argparser/testfiles/test1.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/test2.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/test3.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir1/test1.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir1/test2.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test0.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.aln", + deleteDir + + "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.aln", }, }, + // + }; } }