@Override public MutationGrouper makeFactory(final Properties props, final CodeSource codeSource, final int numberOfThreads, final int unitSize) { return new DefaultGrouper(unitSize); }
@Override public void end() { for (final MutationInterceptor each : this.children) { each.end(); } }
@Override public MutationInterceptor createInterceptor(InterceptorParameters params) { if (params.data().isDetectInlinedCode()) { return new InlinedFinallyBlockFilter(); } return CompoundMutationInterceptor.nullInterceptor(); }
private static Function<MutationInterceptorFactory, MutationInterceptor> toInterceptor( final FeatureSelector<MutationInterceptorFactory> features, final ReportOptions data, final ClassByteArraySource source) { return a -> a.createInterceptor(new InterceptorParameters(features.getSettingForFeature(a.provides().name()), data, source)); } }
private void makeTesteeWithUnitSizeOf(int unitSize) { this.testee = new MutationTestBuilder(this.wf, new NullAnalyser(), this.source, new DefaultGrouper(unitSize)); }
private MutationAnalysisUnit makeUnanalysedUnit( final Collection<MutationDetails> needAnalysis) { final Set<ClassName> uniqueTestClasses = new HashSet<>(); FCollection.flatMapTo(needAnalysis, mutationDetailsToTestClass(), uniqueTestClasses); return new MutationTestUnit(needAnalysis, uniqueTestClasses, this.workerFactory); }
private Collection<MutationDetails> findMutants(ClassName clazz) { final MutationSource source = createSource(this.cbas); return source.createMutations(clazz); }
public MutationInterceptor createInterceptor( ReportOptions data, ClassByteArraySource source) { final List<MutationInterceptor> interceptors = FCollection.map(this.features.getActiveFeatures(), toInterceptor(this.features, data, source)); return new CompoundMutationInterceptor(interceptors); }
@Override public Collection<MutationDetails> intercept( Collection<MutationDetails> mutations, Mutater m) { Collection<MutationDetails> modified = mutations; for (final MutationInterceptor each : this.children) { modified = each.intercept(modified, m); } return modified; }
@Override public TestPrioritiser makeTestPrioritiser(final Properties props, final CodeSource code, final CoverageDatabase coverage) { return new DefaultTestPrioritiser(coverage); }
private MutationAnalysisUnit makePreAnalysedUnit( final List<MutationResult> analysed) { return new KnownStatusMutationTestUnit(analysed); }
@Override public void begin(ClassTree clazz) { for (final MutationInterceptor each : this.children) { each.begin(clazz); } }
private Function<ClassName, Iterable<MutationDetails>> classToMutations() { return a -> MutationTestBuilder.this.mutationSource.createMutations(a); }
@Test public void shouldCreateSingleUnitPerClassWhenUnitSizeIsLessThanZero() { makeTesteeWithUnitSizeOf(-1); assertCreatesOneUnitForTwoMutations(); }
private TestInfo testInfo(final int time, final String target) { return testInfo(time, target, 0); }
private void makeTesteeWithUnitSizeOf(final int i) { this.testee = new DefaultGrouper(i); }