org.gradle.api.internal.tasks.testing.WorkerTestClassProcessorFactory Java Examples

The following examples show how to use org.gradle.api.internal.tasks.testing.WorkerTestClassProcessorFactory. 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: ForkingTestClassProcessor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #2
Source File: DefaultTestExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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();
}
 
Example #3
Source File: ForkingTestClassProcessor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #4
Source File: DefaultTestExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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();
}
 
Example #5
Source File: DefaultTestExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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();
}
 
Example #6
Source File: ForkingTestClassProcessor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #7
Source File: ForkingTestClassProcessor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #8
Source File: DefaultTestExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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();
}
 
Example #9
Source File: ForciblyStoppableTestWorker.java    From gradle-dockerized-test-plugin with Apache License 2.0 4 votes vote down vote up
public ForciblyStoppableTestWorker(WorkerTestClassProcessorFactory factory)
{
    super(factory);
}
 
Example #10
Source File: TestWorker.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TestWorker(WorkerTestClassProcessorFactory factory) {
    this.factory = factory;
}
 
Example #11
Source File: JUnitTestFramework.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    verifyJUnitCategorySupport();
    verifyJUnitFilteringSupport();
    return new TestClassProcessorFactoryImpl(new JUnitSpec(options, filter.getIncludePatterns()));
}
 
Example #12
Source File: TestNGTestFramework.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    options.setTestResources(testTask.getTestSrcDirs());
    List<File> suiteFiles = options.getSuites(testTask.getTemporaryDir());
    return new TestClassProcessorFactoryImpl(options.getOutputDirectory(), new TestNGSpec(options, filter), suiteFiles);
}
 
Example #13
Source File: TestWorker.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TestWorker(WorkerTestClassProcessorFactory factory) {
    this.factory = factory;
}
 
Example #14
Source File: JUnitTestFramework.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    verifyJUnitCategorySupport();
    verifyJUnitFilteringSupport();
    return new TestClassProcessorFactoryImpl(new JUnitSpec(options.getIncludeCategories(), options.getExcludeCategories(), filter.getIncludePatterns()));
}
 
Example #15
Source File: TestNGTestFramework.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    options.setTestResources(testTask.getTestSrcDirs());
    List<File> suiteFiles = options.getSuites(testTask.getTemporaryDir());
    return new TestClassProcessorFactoryImpl(options.getOutputDirectory(), new TestNGSpec(options, filter), suiteFiles);
}
 
Example #16
Source File: TestNGTestFramework.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    options.setTestResources(testTask.getTestSrcDirs());
    List<File> suiteFiles = options.getSuites(testTask.getTemporaryDir());
    return new TestClassProcessorFactoryImpl(options.getOutputDirectory(), new TestNGSpec(options, filter), suiteFiles);
}
 
Example #17
Source File: TestWorker.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TestWorker(WorkerTestClassProcessorFactory factory) {
    this.factory = factory;
}
 
Example #18
Source File: JUnitTestFramework.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    verifyJUnitCategorySupport();
    verifyJUnitFilteringSupport();
    return new TestClassProcessorFactoryImpl(new JUnitSpec(options, filter.getIncludePatterns()));
}
 
Example #19
Source File: TestNGTestFramework.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    options.setTestResources(testTask.getTestSrcDirs());
    List<File> suiteFiles = options.getSuites(testTask.getTemporaryDir());
    return new TestClassProcessorFactoryImpl(options.getOutputDirectory(), new TestNGSpec(options, filter), suiteFiles);
}
 
Example #20
Source File: TestWorker.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TestWorker(WorkerTestClassProcessorFactory factory) {
    this.factory = factory;
}
 
Example #21
Source File: JUnitTestFramework.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkerTestClassProcessorFactory getProcessorFactory() {
    verifyJUnitCategorySupport();
    verifyJUnitFilteringSupport();
    return new TestClassProcessorFactoryImpl(new JUnitSpec(options.getIncludeCategories(), options.getExcludeCategories(), filter.getIncludePatterns()));
}