use of org.apache.maven.scm.command.mkdir.MkdirScmResult in project maven-scm by apache.
the class MkdirCommandTckTest method testMkdirCommandMkdirLocal.
public void testMkdirCommandMkdirLocal() throws Exception {
ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, null, true);
assertResultIsSuccess(result);
assertNotNull(result.getCreatedDirs());
assertTrue("Directory should have been added.", 1 == result.getCreatedDirs().size());
}
use of org.apache.maven.scm.command.mkdir.MkdirScmResult in project maven-scm by apache.
the class SvnMkdirCommandTckTest method testMkdirCommandDirAlreadyAdded.
public void testMkdirCommandDirAlreadyAdded() throws Exception {
ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, null, false);
assertResultIsSuccess(result);
assertNotNull(result.getRevision());
ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
assertTrue("Directory should have been found.", listResult.isSuccess());
// add the directory again
result = getScmManager().mkdir(getScmRepository(), fileSet, null, false);
printOutputError(result);
assertFalse(result.isSuccess());
}
use of org.apache.maven.scm.command.mkdir.MkdirScmResult in project maven-scm by apache.
the class SvnMkdirCommandTckTest method testMkdirCommandMkdirUrl.
public void testMkdirCommandMkdirUrl() throws Exception {
ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, "Mkdir message", false);
assertResultIsSuccess(result);
assertNotNull(result.getRevision());
ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
assertTrue("Directory should have been found.", listResult.isSuccess());
}
use of org.apache.maven.scm.command.mkdir.MkdirScmResult in project maven-scm by apache.
the class IntegrityScmProvider method mkdir.
/**
* Maps to si createsubproject
*/
@Override
protected MkdirScmResult mkdir(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params) throws ScmException {
IntegrityMkdirCommand command = new IntegrityMkdirCommand();
command.setLogger(getLogger());
return (MkdirScmResult) command.execute(repository, fileSet, params);
}
use of org.apache.maven.scm.command.mkdir.MkdirScmResult in project maven-scm by apache.
the class AbstractCvsMkdirCommand method executeMkdirCommand.
/**
* {@inheritDoc}
*/
protected MkdirScmResult executeMkdirCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean createInLocal) throws ScmException {
CommandParameters parameters = new CommandParameters();
parameters.setString(CommandParameter.MESSAGE, message == null ? "" : message);
parameters.setString(CommandParameter.BINARY, "false");
// just invoke add command
Command cmd = getAddCommand();
cmd.setLogger(getLogger());
ScmResult addResult = cmd.execute(repository, fileSet, parameters);
if (!addResult.isSuccess()) {
return new MkdirScmResult(addResult.getCommandLine().toString(), "The cvs command failed.", addResult.getCommandOutput(), false);
}
List<ScmFile> addedFiles = new ArrayList<ScmFile>();
for (File file : fileSet.getFileList()) {
ScmFile scmFile = new ScmFile(file.getPath(), ScmFileStatus.ADDED);
addedFiles.add(scmFile);
}
return new MkdirScmResult(addResult.getCommandLine().toString(), addedFiles);
}
Aggregations