use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class JazzCheckInCommandTest method testCreateCheckInCommandCheckingInLocalChanges.
public void testCreateCheckInCommandCheckingInLocalChanges() throws Exception {
JazzScmProviderRepository repo = getScmProviderRepository();
Commandline cmd = new JazzCheckInCommand().createCheckInCommand(repo, new ScmFileSet(getWorkingDirectory())).getCommandline();
String expected = "scm checkin --username myUserName --password myPassword .";
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class JazzCheckInCommandTest method testCreateChangesetAssociateCommand.
public void testCreateChangesetAssociateCommand() throws Exception {
JazzScmProviderRepository repo = getScmProviderRepository();
// Populate the values that are normally parsed and set by the StatusConsumer.
repo.setWorkItem("215762");
Commandline cmd = new JazzCheckInCommand().createChangesetAssociateCommand(repo, new Integer(1234)).getCommandline();
// Because we do not use a ScmFileSet, the working dir is not set, so the test fails.
cmd.setWorkingDirectory(getWorkingDirectory());
String expected = "scm changeset associate --username myUserName --password myPassword 1234 215762";
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class ClearCaseTagCommandTest method testCommand.
public void testCommand() throws Exception {
ScmFileSet scmFileSet = new ScmFileSet(getWorkingDirectory(), new File("test.java"));
Commandline commandLine = ClearCaseTagCommand.createCommandLine(scmFileSet, "TEST_LABEL_V1.0");
assertCommandLine("cleartool mklabel TEST_LABEL_V1.0 test.java", getWorkingDirectory(), commandLine);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class ClearCaseUpdateCommandTest method testCommand.
public void testCommand() throws Exception {
ScmFileSet scmFileSet = new ScmFileSet(getWorkingDirectory());
Commandline commandLine = ClearCaseUpdateCommand.createCommandLine(scmFileSet);
assertCommandLine("cleartool update -f", getWorkingDirectory(), commandLine);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class ClearCaseAddCommand method createCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
public static Commandline createCommandLine(ScmFileSet scmFileSet) {
Commandline command = new Commandline();
File workingDirectory = scmFileSet.getBasedir();
command.setWorkingDirectory(workingDirectory.getAbsolutePath());
command.setExecutable("cleartool");
command.createArg().setValue("mkelem");
command.createArg().setValue("-c");
command.createArg().setValue("new file");
command.createArg().setValue("-nco");
for (File file : scmFileSet.getFileList()) {
command.createArg().setValue(file.getName());
}
return command;
}
Aggregations