Java Code Examples for org.pitest.functional.FCollection#fold()

The following examples show how to use org.pitest.functional.FCollection#fold() . 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: MutationStatisticsPrecursor.java    From pitest with Apache License 2.0 5 votes vote down vote up
public MutationStatistics toStatistics() {
  final Iterable<Score> scores = getScores();
  final long totalMutations = FCollection.fold(addTotals(), 0L, scores);
  final long totalDetected = FCollection
      .fold(addDetectedTotals(), 0L, scores);
  final long totalWithCoverage = FCollection.fold(addCoveredTotals(), 0L, scores);
  return new MutationStatistics(scores, totalMutations, totalDetected, totalWithCoverage,
      this.numberOfTestsRun);
}
 
Example 2
Source File: ScorePrecursor.java    From pitest with Apache License 2.0 4 votes vote down vote up
private long getTotalMutations() {
  return FCollection.fold(addTotals(), 0L, this.counts.values());
}
 
Example 3
Source File: ScorePrecursor.java    From pitest with Apache License 2.0 4 votes vote down vote up
private long getTotalDetectedMutations() {
  return FCollection.fold(addTotals(), 0L,
      FCollection.filter(this.counts.values(), isDetected()));
}
 
Example 4
Source File: ScorePrecursor.java    From pitest with Apache License 2.0 4 votes vote down vote up
private long getTotalMutationsWithCoverage() {
  return FCollection.fold(addTotals(), 0L,
          FCollection.filter(this.counts.values(), hasCoverage()));
}
 
Example 5
Source File: CoverageData.java    From pitest with Apache License 2.0 4 votes vote down vote up
private int numberOfLines() {
  return FCollection.fold(numberLines(), 0,
      this.code.getClassInfo(allClasses()));
}
 
Example 6
Source File: MetaDataExtractor.java    From pitest with Apache License 2.0 4 votes vote down vote up
public int getNumberOfTestsRun() {
  final BiFunction<Integer, MutationResult, Integer> sum = (a, b) -> a + b.getNumberOfTestsRun();
  return FCollection.fold(sum, 0, this.data);
}
 
Example 7
Source File: PitError.java    From pitest with Apache License 2.0 4 votes vote down vote up
private static String createInputString(final List<String> inputArguments) {
  final StringBuilder sb = new StringBuilder();
  FCollection.fold(append(), sb, inputArguments);
  return sb.toString();
}
 
Example 8
Source File: DependencyExtractor.java    From pitest with Apache License 2.0 4 votes vote down vote up
private Map<String, List<DependencyAccess>> groupDependenciesByClass(
    final Set<DependencyAccess> relevantDependencies) {
  return FCollection.fold(addDependenciesToMap(),
      new HashMap<String, List<DependencyAccess>>(), relevantDependencies);

}
 
Example 9
Source File: MutationTestSummaryData.java    From pitest with Apache License 2.0 4 votes vote down vote up
private int getNumberOfLines() {
  return FCollection.fold(accumulateCodeLines(), 0, this.classes);
}