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

The following examples show how to use org.pitest.functional.FCollection#contains() . 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: LoggingCallsFilter.java    From pitest with Apache License 2.0 5 votes vote down vote up
@Override
public void visitMethodInsn(final int opcode, final String owner,
    final String name, final String desc, boolean itf) {
  if (FCollection.contains(this.loggingClasses, matches(owner))) {
    this.lines.add(this.currentLineNumber);
  }
}
 
Example 2
Source File: DefaultBuildVerifier.java    From pitest with Apache License 2.0 5 votes vote down vote up
private void checkAtLeastOneClassHasLineNumbers(
    final Collection<ClassInfo> codeClasses) {
  // perform only a weak check for line numbers as
  // some jvm languages are not guaranteed to produce them for all classes
  if (!FCollection.contains(codeClasses, aClassWithLineNumbers())) {
    throw new PitHelpError(Help.NO_LINE_NUMBERS);
  }
}
 
Example 3
Source File: SettingsFactory.java    From pitest with Apache License 2.0 4 votes vote down vote up
private static Predicate<MutationResultListenerFactory> nameMatches(
    final Iterable<String> outputFormats) {
  return a -> FCollection.contains(outputFormats, equalsIgnoreCase(a.name()));
}
 
Example 4
Source File: DefaultBuildVerifier.java    From pitest with Apache License 2.0 4 votes vote down vote up
private boolean hasAtLeastOneClass(final Collection<ClassInfo> codeClasses) {
  return FCollection.contains(codeClasses, aConcreteClass());
}
 
Example 5
Source File: MutationStatisticsListenerTest.java    From pitest with Apache License 2.0 4 votes vote down vote up
private boolean hasResultFor(final String mutator) {
  return FCollection.contains(this.testee.getStatistics().getScores(),
      hasResultForMutator(mutator));
}
 
Example 6
Source File: TestNGTestUnitFinder.java    From pitest with Apache License 2.0 4 votes vote down vote up
private boolean hasMethodAnnotation(final Class<?> clazz) {
  return FCollection.contains(Reflection.allMethods(clazz),
      IsAnnotatedWith.instance(org.testng.annotations.Test.class));
}
 
Example 7
Source File: JUnitCustomRunnerTestUnitFinder.java    From pitest with Apache License 2.0 4 votes vote down vote up
private boolean hasAnnotation(final Set<? extends AccessibleObject> methods,
    final Class<? extends Annotation> annotation) {
  return FCollection.contains(methods, IsAnnotatedWith.instance(annotation));
}
 
Example 8
Source File: AnnotatedLineFactory.java    From pitest with Apache License 2.0 4 votes vote down vote up
private boolean isCodeLine(final int line) {
  return FCollection.contains(this.classesInFile, a -> a.isCodeLine(line));
}
 
Example 9
Source File: AnnotatedLineFactory.java    From pitest with Apache License 2.0 4 votes vote down vote up
private boolean isLineCovered(final int line) {
  final Predicate<ClassInfo> predicate = a -> !AnnotatedLineFactory.this.statistics.getTestsForClassLine(
      new ClassLine(a.getName().asInternalName(), line)).isEmpty();
  return FCollection.contains(this.classesInFile, predicate);

}
 
Example 10
Source File: NonEmptyProjectCheck.java    From pitest with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public boolean test(MavenProject project) {
  return FCollection.contains(project.getTestCompileSourceRoots(), exists()) 
      && FCollection.contains(project.getCompileSourceRoots(), exists());
}