public ForkingTestClassProcessor(WorkerProcessFactory workerFactory, WorkerTestClassProcessorFactory processorFactory, JavaForkOptions options, Iterable<File> classPath, Action<WorkerProcessBuilder> buildConfigAction, ModuleRegistry moduleRegistry, BuildOperationWorkerRegistry.Operation owner) { this.workerFactory = workerFactory; this.processorFactory = processorFactory; this.options = options; this.classPath = classPath; this.buildConfigAction = buildConfigAction; this.moduleRegistry = moduleRegistry; this.owner = owner; }
@Override public WorkerTestClassProcessorFactory getProcessorFactory() { verifyConfigFailurePolicy(); verifyPreserveOrder(); verifyGroupByInstances(); List<File> suiteFiles = options.getSuites(testTask.getTemporaryDir()); TestNGSpec spec = new TestNGSpec(options, filter); return new TestClassProcessorFactoryImpl(this.options.getOutputDirectory(), spec, suiteFiles); }
@Override public void execute(final Test testTask, TestResultProcessor testResultProcessor) { final TestFramework testFramework = testTask.getTestFramework(); final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory(); final BuildOperationWorkerRegistry.Operation currentOperation = buildOperationWorkerRegistry.getCurrent(); final Set<File> classpath = ImmutableSet.copyOf(testTask.getClasspath()); final Factory<TestClassProcessor> forkingProcessorFactory = new Factory<TestClassProcessor>() { public TestClassProcessor create() { return new ForkingTestClassProcessor(workerFactory, testInstanceFactory, testTask, classpath, testFramework.getWorkerConfigurationAction(), moduleRegistry, currentOperation); } }; Factory<TestClassProcessor> reforkingProcessorFactory = new Factory<TestClassProcessor>() { public TestClassProcessor create() { return new RestartEveryNTestClassProcessor(forkingProcessorFactory, testTask.getForkEvery()); } }; TestClassProcessor processor = new MaxNParallelTestClassProcessor(testTask.getMaxParallelForks(), reforkingProcessorFactory, actorFactory); final FileTree testClassFiles = testTask.getCandidateClassFiles(); Runnable detector; if (testTask.isScanForTestClasses()) { TestFrameworkDetector testFrameworkDetector = testTask.getTestFramework().getDetector(); testFrameworkDetector.setTestClassesDirectory(testTask.getTestClassesDir()); testFrameworkDetector.setTestClasspath(classpath); detector = new DefaultTestClassScanner(testClassFiles, testFrameworkDetector, processor); } else { detector = new DefaultTestClassScanner(testClassFiles, null, processor); } final Object testTaskOperationId = buildOperationExecutor.getCurrentOperation().getId(); new TestMainAction(detector, processor, testResultProcessor, new TrueTimeProvider(), testTaskOperationId, testTask.getPath(), "Gradle Test Run " + testTask.getIdentityPath()).run(); }
public ForkingTestClassProcessor(WorkerProcessFactory workerFactory, WorkerTestClassProcessorFactory processorFactory, JavaForkOptions options, Iterable<File> classPath, Action<WorkerProcessBuilder> buildConfigAction, ModuleRegistry moduleRegistry) { this.workerFactory = workerFactory; this.processorFactory = processorFactory; this.options = options; this.classPath = classPath; this.buildConfigAction = buildConfigAction; this.moduleRegistry = moduleRegistry; }
public void execute(final Test testTask, TestResultProcessor testResultProcessor) { final TestFramework testFramework = testTask.getTestFramework(); final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory(); final Factory<TestClassProcessor> forkingProcessorFactory = new Factory<TestClassProcessor>() { public TestClassProcessor create() { return new ForkingTestClassProcessor(workerFactory, testInstanceFactory, testTask, testTask.getClasspath(), testFramework.getWorkerConfigurationAction()); } }; Factory<TestClassProcessor> reforkingProcessorFactory = new Factory<TestClassProcessor>() { public TestClassProcessor create() { return new RestartEveryNTestClassProcessor(forkingProcessorFactory, testTask.getForkEvery()); } }; TestClassProcessor processor = new MaxNParallelTestClassProcessor(testTask.getMaxParallelForks(), reforkingProcessorFactory, actorFactor); final FileTree testClassFiles = testTask.getCandidateClassFiles(); Runnable detector; if (testTask.isScanForTestClasses()) { TestFrameworkDetector testFrameworkDetector = testTask.getTestFramework().getDetector(); testFrameworkDetector.setTestClassesDirectory(testTask.getTestClassesDir()); testFrameworkDetector.setTestClasspath(testTask.getClasspath()); detector = new DefaultTestClassScanner(testClassFiles, testFrameworkDetector, processor); } else { detector = new DefaultTestClassScanner(testClassFiles, null, processor); } new TestMainAction(detector, processor, testResultProcessor, new TrueTimeProvider()).run(); }
public ForkingTestClassProcessor(Factory<WorkerProcessBuilder> workerFactory, WorkerTestClassProcessorFactory processorFactory, JavaForkOptions options, Iterable<File> classPath, Action<WorkerProcessBuilder> buildConfigAction) { this.workerFactory = workerFactory; this.processorFactory = processorFactory; this.options = options; this.classPath = classPath; this.buildConfigAction = buildConfigAction; }
public TestWorker(WorkerTestClassProcessorFactory factory) { this.factory = factory; }
@Override public WorkerTestClassProcessorFactory getProcessorFactory() { return new TestClassProcessorFactoryImpl(new JUnitSpec(options.getIncludeCategories(), options.getExcludeCategories(), filter.getIncludePatterns())); }
@Override public void execute(final Test testTask, TestResultProcessor testResultProcessor) { final TestFramework testFramework = testTask.getTestFramework(); final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory(); final Set<File> classpath = ImmutableSet.copyOf(testTask.getClasspath()); final Factory<TestClassProcessor> forkingProcessorFactory = new Factory<TestClassProcessor>() { public TestClassProcessor create() { return new ForkingTestClassProcessor(workerFactory, testInstanceFactory, testTask, classpath, testFramework.getWorkerConfigurationAction(), moduleRegistry); } }; Factory<TestClassProcessor> reforkingProcessorFactory = new Factory<TestClassProcessor>() { public TestClassProcessor create() { return new RestartEveryNTestClassProcessor(forkingProcessorFactory, testTask.getForkEvery()); } }; TestClassProcessor processor = new MaxNParallelTestClassProcessor(testTask.getMaxParallelForks(), reforkingProcessorFactory, actorFactory); final FileTree testClassFiles = testTask.getCandidateClassFiles(); Runnable detector; if (testTask.isScanForTestClasses()) { TestFrameworkDetector testFrameworkDetector = testTask.getTestFramework().getDetector(); testFrameworkDetector.setTestClasses(testTask.getTestClassesDirs().getFiles()); testFrameworkDetector.setTestClasspath(classpath); detector = new DefaultTestClassScanner(testClassFiles, testFrameworkDetector, processor); } else { detector = new DefaultTestClassScanner(testClassFiles, null, processor); } Object testTaskOperationId; try { testTaskOperationId = buildOperationExecutor.getCurrentOperation().getParentId(); } catch (Exception e) { testTaskOperationId = UUID.randomUUID(); } new TestMainAction(detector, processor, testResultProcessor, clock, testTaskOperationId, testTask.getPath(), "Gradle Test Run " + testTask.getIdentityPath()).run(); }
public ForciblyStoppableTestWorker(WorkerTestClassProcessorFactory factory) { super(factory); }
public WorkerTestClassProcessorFactory getProcessorFactory() { options.setTestResources(testTask.getTestSrcDirs()); List<File> suiteFiles = options.getSuites(testTask.getTemporaryDir()); return new TestClassProcessorFactoryImpl(options.getOutputDirectory(), new TestNGSpec(options, filter), suiteFiles); }
public WorkerTestClassProcessorFactory getProcessorFactory() { verifyJUnitCategorySupport(); verifyJUnitFilteringSupport(); return new TestClassProcessorFactoryImpl(new JUnitSpec(options.getIncludeCategories(), options.getExcludeCategories(), filter.getIncludePatterns())); }
public WorkerTestClassProcessorFactory getProcessorFactory() { verifyJUnitCategorySupport(); verifyJUnitFilteringSupport(); return new TestClassProcessorFactoryImpl(new JUnitSpec(options, filter.getIncludePatterns())); }