@Test public void checkAllOfTheOtherFieldsParseOkHere() throws Exception { parser.parse(("-U userid -Ppassword --driver a.b.c --url b:c:d " + "--scriptdirectory . -o output.sql " + "--changeLogTableName my-change-log " + "--dbms ora " + "--templatedir /tmp/mytemplates " + "--delimiter \\ --delimitertype row").split(" "), dbDeploy); assertThat(dbDeploy.getUserid(), is("userid")); assertThat(dbDeploy.getPassword(), is("password")); assertThat(dbDeploy.getDriver(), is("a.b.c")); assertThat(dbDeploy.getUrl(), is("b:c:d")); assertThat(dbDeploy.getScriptdirectory().getName(), is(".")); assertThat(dbDeploy.getOutputfile().getName(), is("output.sql")); assertThat(dbDeploy.getDbms(), is("ora")); assertThat(dbDeploy.getChangeLogTableName(), is("my-change-log")); assertThat(dbDeploy.getDelimiter(), is("\\")); assertThat(dbDeploy.getDelimiterType(), is(DelimiterType.row)); assertThat(dbDeploy.getTemplatedir().getPath(), is(File.separator + "tmp" + File.separator + "mytemplates")); }
public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } DbDeployCommandLineParser();  DbDeployCommandLineParser(UserInputReader userInputReader); }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } DbDeployCommandLineParser();  DbDeployCommandLineParser(UserInputReader userInputReader); void parse(String[] args, DbDeploy dbDeploy); void printUsage(); }
DbDeployCommandLineParser { public void parse(String[] args, DbDeploy dbDeploy) throws UsageException { try { dbDeploy.setScriptdirectory(new File(".")); final CommandLine commandLine = new GnuParser().parse(getOptions(), args); copyValuesFromCommandLineToDbDeployBean(dbDeploy, commandLine); if (commandLine.hasOption("password") && commandLine.getOptionValue("password") == null) { dbDeploy.setPassword(userInputReader.read("Password")); } } catch (ParseException e) { throw new UsageException(e.getMessage(), e); } } DbDeployCommandLineParser();  DbDeployCommandLineParser(UserInputReader userInputReader); void parse(String[] args, DbDeploy dbDeploy); void printUsage();  }