From: Ben Soares Date: Mon, 24 Apr 2023 15:52:13 +0000 (+0100) Subject: JAL-629 Add --nowebdiscovery. Distinguish arg=="open" as old style. Increase timeout... X-Git-Tag: Release_2_11_4_0~376 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=13cb17a0bdff818a32d253e2199105d9def58796;p=jalview.git JAL-629 Add --nowebdiscovery. Distinguish arg=="open" as old style. Increase timeout for commandlineoptions tests (for failing web services?). --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index d70326e..e384a0b 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -630,7 +630,12 @@ public class Jalview } } - if (!aparser.contains("nowebservicediscovery")) + boolean doWebServiceDiscovery = !aparser + .contains("nowebservicediscovery"); + if (bootstrapArgs.contains(Arg.WEBSERVICEDISCOVERY)) + doWebServiceDiscovery = bootstrapArgs + .getBoolean(Arg.WEBSERVICEDISCOVERY); + if (doWebServiceDiscovery) { desktop.startServiceDiscovery(); } diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 07d8c28..ab3cca7 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -11,11 +11,12 @@ public enum Arg { HELP("h"), CALCULATION, MENUBAR, STATUS, SHOWOVERVIEW, ANNOTATIONS, COLOUR, FEATURES, GROOVY, GROUPS, HEADLESS, JABAWS, DISPLAY, GUI, NEWS, - SORTBYTREE, USAGESTATS, APPEND, OPEN, PROPS, QUESTIONNAIRE, SETPROP, - TREE, VDOC, VSESS, OUTPUT, OUTPUTTYPE, SSANNOTATIONS, NOTEMPFAC, TEMPFAC, - TITLE, PAEMATRIX, WRAP, NOSTRUCTURE, STRUCTURE, STRUCTUREVIEWER, IMAGE, - QUIT, CLOSE, DEBUG("d"), QUIET("q"), ARGFILE, INCREMENT, NPP("n++"), - SUBSTITUTIONS, INITSUBSTITUTIONS, NIL, SPLASH, SETARGFILE, UNSETARGFILE; + SORTBYTREE, USAGESTATS, APPEND, OPEN, PROPS, QUESTIONNAIRE, SETPROP, TREE, + VDOC, VSESS, OUTPUT, OUTPUTTYPE, SSANNOTATIONS, NOTEMPFAC, TEMPFAC, TITLE, + PAEMATRIX, WRAP, NOSTRUCTURE, STRUCTURE, STRUCTUREVIEWER, IMAGE, QUIT, + CLOSE, DEBUG("d"), QUIET("q"), ARGFILE, INCREMENT, NPP("n++"), + SUBSTITUTIONS, INITSUBSTITUTIONS, NIL, SPLASH, SETARGFILE, UNSETARGFILE, + WEBSERVICEDISCOVERY; protected static enum Opt { @@ -87,6 +88,7 @@ public enum Arg NIL.setOptions(Opt.UNARY, Opt.LINKED, Opt.MULTI, Opt.NOACTION); SETARGFILE.setOptions(Opt.STRING, Opt.MULTI, Opt.PRIVATE, Opt.NOACTION); UNSETARGFILE.setOptions(Opt.MULTI, Opt.PRIVATE, Opt.NOACTION); + WEBSERVICEDISCOVERY.setOptions(Opt.BOOLEAN, Opt.BOOTSTRAP); // Opt.BOOTSTRAP args are parsed (not linked with no SubVals so using a // simplified parser, see jalview.bin.argparser.BootstrapArgs) // before a full parse of arguments and so can be accessible at an earlier diff --git a/src/jalview/bin/argparser/ArgParser.java b/src/jalview/bin/argparser/ArgParser.java index b31beab..0ab5987 100644 --- a/src/jalview/bin/argparser/ArgParser.java +++ b/src/jalview/bin/argparser/ArgParser.java @@ -156,7 +156,8 @@ public class ArgParser public ArgParser(List args, boolean initsubstitutions, boolean allowPrivate) { - // do nothing if there are no "--" args and some "-" args + // do nothing if there are no "--" args and (some "-" args || >0 arg is + // "open") boolean d = false; boolean dd = false; for (String arg : args) @@ -166,7 +167,7 @@ public class ArgParser dd = true; break; } - else if (arg.startsWith("-")) + else if (arg.startsWith("-") || arg.equals("open")) { d = true; } diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index c6d3332..9b9adf8 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -54,7 +54,7 @@ public class CommandLineOperations } // Note longer timeout needed on full test run than on individual tests - private static final int TEST_TIMEOUT = 13000; + private static final int TEST_TIMEOUT = 23000; private static final int SETUP_TIMEOUT = 9500; @@ -373,9 +373,11 @@ public class CommandLineOperations // since it works. // https://issues.jalview.org/browse/JAL-1889?focusedCommentId=21609&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-21609 String workingDir = "test/jalview/bin/"; - return new Object[][] { { "nodisplay -open examples/uniref50.fa", - " -eps", workingDir + "test_uniref50_out.eps", true, - MINFILESIZE_BIG, TEST_TIMEOUT }, + return new Object[][] { + // + { "nodisplay -open examples/uniref50.fa", " -eps", + workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG, + TEST_TIMEOUT }, { "nodisplay -open examples/uniref50.fa", " -eps", workingDir + "test_uniref50_out.eps", false, MINFILESIZE_BIG, TEST_TIMEOUT }, @@ -420,6 +422,8 @@ public class CommandLineOperations TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -jalview", workingDir + "test_uniref50_out.jvp", true, MINFILESIZE_SMALL, - TEST_TIMEOUT }, }; + TEST_TIMEOUT }, + // + }; } }