public MutationStrategies with(final BuildVerifier verifier) { return new MutationStrategies(this.factory, this.history, this.coverage, this.listenerFactory, this.output, verifier); }
private CoverageGenerator coverage() { return this.strategies.coverage(); }
private HistoryStore history() { return this.strategies.history(); }
private CombinedStatistics createAndRunTestee() { final MutationStrategies strategies = new MutationStrategies( new GregorEngineFactory(), this.history, this.coverage, this.listenerFactory, this.output).with(this.mutationFactory).with( this.verifier); this.testee = new MutationCoverage(strategies, null, this.code, this.data, new SettingsFactory(this.data, PluginServices.makeForContextLoader()), new Timings()); try { return this.testee.runReport(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private List<MutationResultListener> createConfig(final long t0, final CoverageDatabase coverageData, final MutationStatisticsListener stats, final MutationEngine engine) { final List<MutationResultListener> ls = new ArrayList<>(); ls.add(stats); final ListenerArguments args = new ListenerArguments( this.strategies.output(), coverageData, new SmartSourceLocator( this.data.getSourceDirs()), engine, t0, this.data.isFullMutationMatrix()); final MutationResultListener mutationReportListener = this.strategies .listenerFactory().getListener(this.data.getFreeFormProperties(), args); ls.add(mutationReportListener); ls.add(new HistoryListener(history())); if (!this.data.isVerbose()) { ls.add(new SpinnerListener(System.out)); } return ls; }
private void verifyBuildSuitableForMutationTesting() { this.strategies.buildVerifier().verify(this.code); }
.withExcludedMethods(this.data.getExcludedMethods()) .withMutators(this.data.getMutators()); final MutationEngine engine = this.strategies.factory().createEngine(args);
public MutationStrategies with(final MutationEngineFactory factory) { return new MutationStrategies(factory, this.history, this.coverage, this.listenerFactory, this.output, this.buildVerifier); }
final MutationStrategies strategies = new MutationStrategies( settings.createEngine(), history, coverageDatabase, reportFactory, reportOutput);
protected void createAndRun(SettingsFactory settings) { final JavaAgent agent = new JarCreatingJarFinder(); try { final CoverageOptions coverageOptions = createCoverageOptions(settings.createCoverageOptions().getPitConfig()); final LaunchOptions launchOptions = new LaunchOptions(agent, new DefaultJavaExecutableLocator(), this.data.getJvmArgs(), new HashMap<String, String>()); final PathFilter pf = new PathFilter(p -> true, p -> true); final ProjectClassPaths cps = new ProjectClassPaths( this.data.getClassPath(), this.data.createClassesFilter(), pf); final Timings timings = new Timings(); final CodeSource code = new CodeSource(cps); final CoverageGenerator coverageDatabase = new DefaultCoverageGenerator( null, coverageOptions, launchOptions, code, new NullCoverageExporter(), timings, false); final HistoryStore history = new NullHistoryStore(); final MutationStrategies strategies = new MutationStrategies( new GregorEngineFactory(), history, coverageDatabase, listenerFactory(), null); final MutationCoverage testee = new MutationCoverage(strategies, null, code, this.data, new SettingsFactory(this.data, this.plugins), timings); testee.runReport(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } finally { agent.close(); } }