@Before public void setUp() { MockitoAnnotations.initMocks(this); this.mutationConfig = new MutationConfig(this.engine, new LaunchOptions( this.javaAgent)); this.mutations = new ArrayList<>(); this.tests = new ArrayList<>(); this.testee = new MutationTestUnit(this.mutations, this.tests, new WorkerFactory(null, TestPluginArguments.defaults(), this.mutationConfig, EngineArguments.arguments(), this.timeout, false, false, null)); }
private void runTestInSeperateProcessForMutationRange( final MutationStatusMap mutations) throws IOException, InterruptedException { final Collection<MutationDetails> remainingMutations = mutations .getUnrunMutations(); final MutationTestProcess worker = this.workerFactory.createWorker( remainingMutations, this.testClasses); worker.start(); setFirstMutationToStatusOfStartedInCaseMinionFailsAtBoot(mutations, remainingMutations); final ExitCode exitCode = waitForMinionToDie(worker); worker.results(mutations); correctResultForProcessExitCode(mutations, exitCode); }
public MutationTestProcess createWorker( final Collection<MutationDetails> remainingMutations, final Collection<ClassName> testClasses) { final MinionArguments fileArgs = new MinionArguments(remainingMutations, testClasses, this.config.getEngine().getName(), this.args, this.timeoutStrategy, Log.isVerbose(), this.fullMutationMatrix, this.pitConfig); final ProcessArgs args = ProcessArgs.withClassPath(this.classPath) .andLaunchOptions(this.config.getLaunchOptions()) .andBaseDir(this.baseDir).andStdout(captureStdOutIfVerbose()) .andStderr(printWith("stderr ")); final SocketFinder sf = new SocketFinder(); final MutationTestProcess worker = new MutationTestProcess( sf.getNextAvailableServerSocket(), args, fileArgs); return worker; }
private List<MutationAnalysisUnit> buildMutationTests( final CoverageDatabase coverageData, final MutationEngine engine, EngineArguments args) { final MutationConfig mutationConfig = new MutationConfig(engine, coverage() .getLaunchOptions()); final ClassByteArraySource bas = fallbackToClassLoader(new ClassPathByteArraySource( this.data.getClassPath())); final TestPrioritiser testPrioritiser = this.settings.getTestPrioritiser() .makeTestPrioritiser(this.data.getFreeFormProperties(), this.code, coverageData); final MutationInterceptor interceptor = this.settings.getInterceptor() .createInterceptor(this.data, bas); final MutationSource source = new MutationSource(mutationConfig, testPrioritiser, bas, interceptor); final MutationAnalyser analyser = new IncrementalAnalyser( new DefaultCodeHistory(this.code, history()), coverageData); final WorkerFactory wf = new WorkerFactory(this.baseDir, coverage() .getConfiguration(), mutationConfig, args, new PercentAndConstantTimeoutStrategy(this.data.getTimeoutFactor(), this.data.getTimeoutConstant()), this.data.isVerbose(), this.data.isFullMutationMatrix(), this.data.getClassPath().getLocalClassPath()); final MutationGrouper grouper = this.settings.getMutationGrouper().makeFactory( this.data.getFreeFormProperties(), this.code, this.data.getNumberOfThreads(), this.data.getMutationUnitSize()); final MutationTestBuilder builder = new MutationTestBuilder(wf, analyser, source, grouper); return builder.createMutationTestUnits(this.code.getCodeUnderTestNames()); }
final WorkerFactory wf = new WorkerFactory(null, coverageOptions.getPitConfig(), mutationConfig, arguments, new PercentAndConstantTimeoutStrategy(data.getTimeoutFactor(),