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

The following examples show how to use org.apache.maven.scm.command.status.StatusScmResult. 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 File: ScmMojo.java    From pitest with 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 File: ScmMojoTest.java    From pitest with 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 File: ScmMojoTest.java    From pitest with 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 File: CreateMojo.java    From buildnumber-maven-plugin with 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 File: ScmMojoTest.java    From pitest with 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()));
}