@Test (expected = IllegalArgumentException.class) public void testJdbcConnectionParamsNoUsername() throws Exception { new ServerCommandLineParser().parse(new String[] {"--port", "1337", "--workflows", "/wf", "--dbType", "jdbc" , "--jdbcUrl", "url", "--jdbcName", "uname", "--defaults", "/defaults"}); }
public ServerCommandLine parse(final String[] commandLineArguments) throws Exception { final CommandLineParser cmdLineGnuParser = new GnuParser(); final Options gnuOptions = constructOptions(); CommandLine commandLine = cmdLineGnuParser.parse(gnuOptions, commandLineArguments); Integer port = Integer.valueOf(getRequiredArgument(commandLine, CLI_PORT)); String defaultsDir = getDefault(commandLine, CLI_DEFAULTS_DIR, Constants.DEFAULT_DEFAULTS_DIR); String workflowsDir = getDefault(commandLine, CLI_WF_DIR, Constants.DEFAULT_WORKFLOWS_DIR); String logDir = getDefault(commandLine, CLI_LOG_DIR, Constants.DEFAULT_LOG_DIR); Integer autoSchedule = Integer.valueOf(getDefault(commandLine, CLI_AUTOSCHEDULE, "-1")); StateDatabase db = getStateDatabaseConfig(commandLine); return new ServerCommandLine(workflowsDir, defaultsDir, db, logDir, port, autoSchedule); }
ServerCommandLineParser { public ServerCommandLine parse(final String[] commandLineArguments) throws Exception { final CommandLineParser cmdLineGnuParser = new GnuParser(); final Options gnuOptions = constructOptions(); CommandLine commandLine = cmdLineGnuParser.parse(gnuOptions, commandLineArguments); Integer port = Integer.valueOf(getRequiredArgument(commandLine, CLI_PORT)); String defaultsDir = getDefault(commandLine, CLI_DEFAULTS_DIR, Constants.DEFAULT_DEFAULTS_DIR); String workflowsDir = getDefault(commandLine, CLI_WF_DIR, Constants.DEFAULT_WORKFLOWS_DIR); String logDir = getDefault(commandLine, CLI_LOG_DIR, Constants.DEFAULT_LOG_DIR); Integer autoSchedule = Integer.valueOf(getDefault(commandLine, CLI_AUTOSCHEDULE, "-1")); StateDatabase db = getStateDatabaseConfig(commandLine); return new ServerCommandLine(workflowsDir, defaultsDir, db, logDir, port, autoSchedule); } }
ServerCommandLineParser { public ServerCommandLine parse(final String[] commandLineArguments) throws Exception { final CommandLineParser cmdLineGnuParser = new GnuParser(); final Options gnuOptions = constructOptions(); CommandLine commandLine = cmdLineGnuParser.parse(gnuOptions, commandLineArguments); Integer port = Integer.valueOf(getRequiredArgument(commandLine, CLI_PORT)); String defaultsDir = getDefault(commandLine, CLI_DEFAULTS_DIR, Constants.DEFAULT_DEFAULTS_DIR); String workflowsDir = getDefault(commandLine, CLI_WF_DIR, Constants.DEFAULT_WORKFLOWS_DIR); String logDir = getDefault(commandLine, CLI_LOG_DIR, Constants.DEFAULT_LOG_DIR); Integer autoSchedule = Integer.valueOf(getDefault(commandLine, CLI_AUTOSCHEDULE, "-1")); StateDatabase db = getStateDatabaseConfig(commandLine); return new ServerCommandLine(workflowsDir, defaultsDir, db, logDir, port, autoSchedule); }  }
ServerCommandLineParser { public ServerCommandLine parse(final String[] commandLineArguments) throws Exception { final CommandLineParser cmdLineGnuParser = new GnuParser(); final Options gnuOptions = constructOptions(); CommandLine commandLine = cmdLineGnuParser.parse(gnuOptions, commandLineArguments); Integer port = Integer.valueOf(getRequiredArgument(commandLine, CLI_PORT)); String defaultsDir = getDefault(commandLine, CLI_DEFAULTS_DIR, Constants.DEFAULT_DEFAULTS_DIR); String workflowsDir = getDefault(commandLine, CLI_WF_DIR, Constants.DEFAULT_WORKFLOWS_DIR); String logDir = getDefault(commandLine, CLI_LOG_DIR, Constants.DEFAULT_LOG_DIR); Integer autoSchedule = Integer.valueOf(getDefault(commandLine, CLI_AUTOSCHEDULE, "-1")); StateDatabase db = getStateDatabaseConfig(commandLine); return new ServerCommandLine(workflowsDir, defaultsDir, db, logDir, port, autoSchedule); }  ServerCommandLine parse(final String[] commandLineArguments); Options constructOptions(); void printHelp(
            final int printedRowWidth,
            final int spacesBeforeOption,
            final int spacesBeforeOptionDescription,
            final boolean displayUsage,
            final OutputStream out); }
ServerCommandLineParser { public ServerCommandLine parse(final String[] commandLineArguments) throws Exception { final CommandLineParser cmdLineGnuParser = new GnuParser(); final Options gnuOptions = constructOptions(); CommandLine commandLine = cmdLineGnuParser.parse(gnuOptions, commandLineArguments); Integer port = Integer.valueOf(getRequiredArgument(commandLine, CLI_PORT)); String defaultsDir = getDefault(commandLine, CLI_DEFAULTS_DIR, Constants.DEFAULT_DEFAULTS_DIR); String workflowsDir = getDefault(commandLine, CLI_WF_DIR, Constants.DEFAULT_WORKFLOWS_DIR); String logDir = getDefault(commandLine, CLI_LOG_DIR, Constants.DEFAULT_LOG_DIR); Integer autoSchedule = Integer.valueOf(getDefault(commandLine, CLI_AUTOSCHEDULE, "-1")); StateDatabase db = getStateDatabaseConfig(commandLine); return new ServerCommandLine(workflowsDir, defaultsDir, db, logDir, port, autoSchedule); }  ServerCommandLine parse(final String[] commandLineArguments); Options constructOptions(); void printHelp(
            final int printedRowWidth,
            final int spacesBeforeOption,
            final int spacesBeforeOptionDescription,
            final boolean displayUsage,
            final OutputStream out); static final String DB_TYPE_FILESYSTEM; static final String DB_TYPE_JDBC; }