use of org.apache.maven.scm.command.export.ExportScmResult in project maven-scm by apache.
the class AccuRevExportCommandTest method testExportVersionOutSideWorkspace.
@Test
public void testExportVersionOutSideWorkspace() throws Exception {
// info defaults to no workspace...
info.setWorkSpace(null);
when(accurev.info(basedir)).thenReturn(info);
List<File> poppedFiles = Collections.singletonList(new File("exported/file"));
when(accurev.popExternal(eq(basedir), eq("mySnapShot"), eq((String) null), (Collection<File>) argThat(hasItem(new File("/./project/dir"))))).thenReturn(poppedFiles);
AccuRevExportCommand command = new AccuRevExportCommand(getLogger());
CommandParameters params = new CommandParameters();
params.setScmVersion(CommandParameter.SCM_VERSION, new ScmTag("mySnapShot"));
ExportScmResult result = command.export(repo, new ScmFileSet(basedir), params);
assertTrue(result.isSuccess());
assertHasScmFile(result.getExportedFiles(), "exported/file", ScmFileStatus.CHECKED_OUT);
}
use of org.apache.maven.scm.command.export.ExportScmResult in project maven-scm by apache.
the class CvsExeExportCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected ExportScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsUpdateConsumer consumer = new CvsUpdateConsumer(getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode;
try {
exitCode = CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing command.", ex);
}
if (exitCode != 0) {
return new ExportScmResult(cl.toString(), "The cvs command failed.", stderr.getOutput(), false);
}
return new ExportScmResult(cl.toString(), consumer.getUpdatedFiles());
}
Aggregations