@Test public void testGetCommandLineArgsWin() throws CruiseControlException { String testExecCmd = "dir"; String[] simpleCmd = { testExecCmd }; ExecScript script = createExecScript(testExecCmd, null); TestUtil.assertArray("simpleCmd", simpleCmd, script.buildCommandline().getCommandline()); String testExecArgs = "C:\\temp"; script = createExecScript(testExecCmd, testExecArgs); String[] detailedCmd = { testExecCmd, testExecArgs }; TestUtil.assertArray("detailedCmd", detailedCmd, script.buildCommandline().getCommandline()); }
public Commandline buildCommandline() throws CruiseControlException { Commandline cmdLine = new Commandline(); if (execCommand != null) { cmdLine.setExecutable(execCommand); } else { throw new CruiseControlException("no command to be executed"); } if (execArgs != null) { cmdLine.addArguments(Commandline.translateCommandline(execArgs)); } if (LOG.isDebugEnabled()) { final StringBuilder sb = new StringBuilder(); sb.append("Executing Command: "); final String[] args = cmdLine.getCommandline(); for (final String arg : args) { sb.append(arg); sb.append(" "); } LOG.debug(sb.toString()); } return cmdLine; }
ExecScript implements Script, StreamConsumer { public Commandline buildCommandline() throws CruiseControlException { Commandline cmdLine = new Commandline(); if (execCommand != null) { cmdLine.setExecutable(execCommand); } else { throw new CruiseControlException("no command to be executed"); } if (execArgs != null) { cmdLine.addArguments(Commandline.translateCommandline(execArgs)); } if (LOG.isDebugEnabled()) { final StringBuilder sb = new StringBuilder(); sb.append("Executing Command: "); final String[] args = cmdLine.getCommandline(); for (final String arg : args) { sb.append(arg); sb.append(" "); } LOG.debug(sb.toString()); } return cmdLine; } }
ExecScript implements Script, StreamConsumer { public Commandline buildCommandline() throws CruiseControlException { Commandline cmdLine = new Commandline(); if (execCommand != null) { cmdLine.setExecutable(execCommand); } else { throw new CruiseControlException("no command to be executed"); } if (execArgs != null) { cmdLine.addArguments(Commandline.translateCommandline(execArgs)); } if (LOG.isDebugEnabled()) { final StringBuilder sb = new StringBuilder(); sb.append("Executing Command: "); final String[] args = cmdLine.getCommandline(); for (final String arg : args) { sb.append(arg); sb.append(" "); } LOG.debug(sb.toString()); } return cmdLine; }  }
ExecScript implements Script, StreamConsumer { public Commandline buildCommandline() throws CruiseControlException { Commandline cmdLine = new Commandline(); if (execCommand != null) { cmdLine.setExecutable(execCommand); } else { throw new CruiseControlException("no command to be executed"); } if (execArgs != null) { cmdLine.addArguments(Commandline.translateCommandline(execArgs)); } if (LOG.isDebugEnabled()) { final StringBuilder sb = new StringBuilder(); sb.append("Executing Command: "); final String[] args = cmdLine.getCommandline(); for (final String arg : args) { sb.append(arg); sb.append(" "); } LOG.debug(sb.toString()); } return cmdLine; }  Commandline buildCommandline(); synchronized void consumeLine(final String line); Element setBuildLogHeader(Element buildLogElement); void setExecArgs(String execArgs); void setExecCommand(String execCommand); int getExitCode(); void setExitCode(int exitCode); void setErrorStr(String errStr); void setBuildLogElement(Element buildLogElement); void setProgress(final Progress progress); boolean wasError(); }
ExecScript implements Script, StreamConsumer { public Commandline buildCommandline() throws CruiseControlException { Commandline cmdLine = new Commandline(); if (execCommand != null) { cmdLine.setExecutable(execCommand); } else { throw new CruiseControlException("no command to be executed"); } if (execArgs != null) { cmdLine.addArguments(Commandline.translateCommandline(execArgs)); } if (LOG.isDebugEnabled()) { final StringBuilder sb = new StringBuilder(); sb.append("Executing Command: "); final String[] args = cmdLine.getCommandline(); for (final String arg : args) { sb.append(arg); sb.append(" "); } LOG.debug(sb.toString()); } return cmdLine; }  Commandline buildCommandline(); synchronized void consumeLine(final String line); Element setBuildLogHeader(Element buildLogElement); void setExecArgs(String execArgs); void setExecCommand(String execCommand); int getExitCode(); void setExitCode(int exitCode); void setErrorStr(String errStr); void setBuildLogElement(Element buildLogElement); void setProgress(final Progress progress); boolean wasError();  }