Java Code Examples for org.apache.maven.scm.command.status.StatusScmResult

The following examples show how to use org.apache.maven.scm.command.status.StatusScmResult. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: pitest   Source File: ScmMojo.java    License: Apache License 2.0 5 votes vote down vote up
private Set<String> localChanges(Set<ScmFileStatus> statusToInclude, ScmRepository repository, File scmRoot) throws ScmException {
  final StatusScmResult status = this.manager.status(repository,
          new ScmFileSet(scmRoot));
  Set<String> affected = new LinkedHashSet<>();
  for (final ScmFile file : status.getChangedFiles()) {
    if (statusToInclude.contains(file.getStatus())) {
      affected.add(file.getPath());
    }
  }
  return affected;
}
 
Example 2
Source Project: pitest   Source File: ScmMojoTest.java    License: Apache License 2.0 5 votes vote down vote up
private void setFileWithStatus(final ScmFileStatus status)
    throws ScmException {
  when(this.manager.status(any(ScmRepository.class), any(ScmFileSet.class)))
      .thenReturn(
          new StatusScmResult("", Arrays.asList(new ScmFile(
              "foo/bar/Bar.java", status))));
}
 
Example 3
Source Project: pitest   Source File: ScmMojoTest.java    License: Apache License 2.0 5 votes vote down vote up
public void testUnknownAndDeletedClassesAreNotMutationTested()
    throws Exception {
  setupConnection();
  when(this.manager.status(any(ScmRepository.class), any(ScmFileSet.class)))
      .thenReturn(
          new StatusScmResult("", Arrays.asList(new ScmFile(
              "foo/bar/Bar.java", ScmFileStatus.DELETED), new ScmFile(
              "foo/bar/Bar.java", ScmFileStatus.UNKNOWN))));
  this.testee.execute();
  verify(this.executionStrategy, never()).execute(any(File.class),
      any(ReportOptions.class), any(PluginServices.class), anyMap());
}
 
Example 4
Source Project: buildnumber-maven-plugin   Source File: CreateMojo.java    License: MIT License 4 votes vote down vote up
public List<ScmFile> getStatus()
    throws ScmException
{

    ScmRepository repository = getScmRepository();

    ScmProvider scmProvider = scmManager.getProviderByRepository( repository );

    StatusScmResult result = scmProvider.status( repository, new ScmFileSet( scmDirectory ) );

    if ( result == null )
    {
        return Collections.emptyList();
    }

    checkResult( result );

    return result.getChangedFiles();

}
 
Example 5
Source Project: pitest   Source File: ScmMojoTest.java    License: Apache License 2.0 4 votes vote down vote up
private void setupToReturnNoModifiedFiles() throws ScmException {
  when(this.manager.status(any(ScmRepository.class), any(ScmFileSet.class)))
      .thenReturn(new StatusScmResult("", Collections.<ScmFile> emptyList()));
}