Search in sources :

Example 1 with AttachParentTestResultProcessor

use of org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor in project gradle by gradle.

the class SuiteTestClassProcessor method startProcessing.

@Override
public void startProcessing(TestResultProcessor testResultProcessor) {
    try {
        resultProcessor = new AttachParentTestResultProcessor(new CaptureTestOutputTestResultProcessor(testResultProcessor, new JULRedirector()));
        resultProcessor.started(suiteDescriptor, new TestStartEvent(timeProvider.getCurrentTime()));
        processor.startProcessing(resultProcessor);
    } catch (Throwable t) {
        resultProcessor.failure(suiteDescriptor.getId(), new TestSuiteExecutionException(String.format("Could not start %s.", suiteDescriptor), t));
    }
}
Also used : CaptureTestOutputTestResultProcessor(org.gradle.api.internal.tasks.testing.processors.CaptureTestOutputTestResultProcessor) AttachParentTestResultProcessor(org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor)

Example 2 with AttachParentTestResultProcessor

use of org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor in project gradle by gradle.

the class JUnitTestClassProcessor method startProcessing.

@Override
public void startProcessing(TestResultProcessor resultProcessor) {
    // Build a result processor chain
    ClassLoader applicationClassLoader = Thread.currentThread().getContextClassLoader();
    TestResultProcessor resultProcessorChain = new AttachParentTestResultProcessor(resultProcessor);
    TestClassExecutionEventGenerator eventGenerator = new TestClassExecutionEventGenerator(resultProcessorChain, idGenerator, timeProvider);
    // Wrap the result processor chain up in a blocking actor, to make the whole thing thread-safe
    resultProcessorActor = actorFactory.createBlockingActor(eventGenerator);
    TestResultProcessor threadSafeResultProcessor = resultProcessorActor.getProxy(TestResultProcessor.class);
    TestClassExecutionListener threadSafeTestClassListener = resultProcessorActor.getProxy(TestClassExecutionListener.class);
    // Build the JUnit adaptor stuff
    JUnitTestEventAdapter junitEventAdapter = new JUnitTestEventAdapter(threadSafeResultProcessor, timeProvider, idGenerator);
    executer = new JUnitTestClassExecuter(applicationClassLoader, spec, junitEventAdapter, threadSafeTestClassListener);
}
Also used : AttachParentTestResultProcessor(org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor) TestResultProcessor(org.gradle.api.internal.tasks.testing.TestResultProcessor) AttachParentTestResultProcessor(org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor)

Aggregations

AttachParentTestResultProcessor (org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor)2 TestResultProcessor (org.gradle.api.internal.tasks.testing.TestResultProcessor)1 CaptureTestOutputTestResultProcessor (org.gradle.api.internal.tasks.testing.processors.CaptureTestOutputTestResultProcessor)1