use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.
the class TfsListCommandTest method testCommandline.
public void testCommandline() throws Exception {
TfsScmProviderRepository repo = getScmProviderRepository();
Commandline cmd = new TfsListCommand().createCommand(repo, getScmFileSet(), true).getCommandline();
String expected = "tf dir -login:user,password -recursive " + getFileList();
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.
the class TfsCheckOutCommand method executeUnmapCommand.
public int executeUnmapCommand(ScmProviderRepository r, ScmFileSet f) throws ScmException {
TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r;
String url = tfsRepo.getServerPath();
String workspace = tfsRepo.getWorkspace();
ErrorStreamConsumer out = new ErrorStreamConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
TfsCommand command = new TfsCommand("workfold", r, null, getLogger());
command.addArgument("-workspace:" + workspace);
command.addArgument("-unmap");
command.addArgument(url);
return command.execute(out, err);
}
use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.
the class TfsTagCommandTest method testCommandline.
public void testCommandline() throws Exception {
TfsScmProviderRepository repo = getScmProviderRepository();
ScmTagParameters param = new ScmTagParameters("Message of many words");
Commandline cmd = new TfsTagCommand().createCommand(repo, getScmFileSet(), "tag", param).getCommandline();
String expected = "tf label -login:user,password tag " + repo.getServerPath() + " -recursive -child:replace -comment:\"Message of many words\"";
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.
the class TfsUpdateCommandTest method testCommandline.
public void testCommandline() throws Exception {
TfsScmProviderRepository repo = getScmProviderRepository();
ScmRevision rev = new ScmRevision("revision");
Commandline cmd = new TfsUpdateCommand().createCommand(repo, getScmFileSet(), rev).getCommandline();
String path = repo.getServerPath();
String expected = "tf get -login:user,password " + path + " -version:Crevision";
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.
the class TfsCheckOutCommand method executeCheckOutCommand.
protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository r, ScmFileSet f, ScmVersion v, boolean recursive, boolean shallow) throws ScmException {
TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r;
String url = tfsRepo.getServerPath();
String tfsUrl = tfsRepo.getTfsUrl();
String workspace = tfsRepo.getWorkspace();
// Try creating workspace
boolean workspaceProvided = workspace != null && !workspace.trim().equals("");
if (workspaceProvided) {
createWorkspace(r, f, workspace, tfsUrl);
}
TfsCommand command;
int status;
if (workspaceProvided) {
status = executeUnmapCommand(r, f);
}
ErrorStreamConsumer out = new ErrorStreamConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
if (workspaceProvided) {
command = new TfsCommand("workfold", r, null, getLogger());
command.addArgument("-workspace:" + workspace);
command.addArgument("-map");
command.addArgument(url);
command.addArgument(f.getBasedir().getAbsolutePath());
status = command.execute(out, err);
if (status != 0 || err.hasBeenFed()) {
return new CheckOutScmResult(command.getCommandString(), "Error code for TFS checkout (workfold map) command - " + status, err.getOutput(), false);
}
}
FileListConsumer fileConsumer = new FileListConsumer();
err = new ErrorStreamConsumer();
command = createGetCommand(r, f, v, recursive);
status = command.execute(fileConsumer, err);
if (status != 0 || err.hasBeenFed()) {
return new CheckOutScmResult(command.getCommandString(), "Error code for TFS checkout (get) command - " + status, err.getOutput(), false);
}
return new CheckOutScmResult(command.getCommandString(), fileConsumer.getFiles());
}
Aggregations