Search in sources :

Example 1 with ContextClassLoaderProxy

use of org.gradle.internal.dispatch.ContextClassLoaderProxy in project gradle by gradle.

the class TestWorker method startReceivingTests.

private void startReceivingTests(WorkerProcessContext workerProcessContext, ServiceRegistry testServices) {
    TestClassProcessor targetProcessor = factory.create(testServices);
    IdGenerator<Object> idGenerator = testServices.get(IdGenerator.class);
    targetProcessor = new WorkerTestClassProcessor(targetProcessor, idGenerator.generateId(), workerProcessContext.getDisplayName(), testServices.get(TimeProvider.class));
    ContextClassLoaderProxy<TestClassProcessor> proxy = new ContextClassLoaderProxy<TestClassProcessor>(TestClassProcessor.class, targetProcessor, workerProcessContext.getApplicationClassLoader());
    processor = proxy.getSource();
    ObjectConnection serverConnection = workerProcessContext.getServerConnection();
    serverConnection.useParameterSerializers(TestEventSerializer.create());
    this.resultProcessor = serverConnection.addOutgoing(TestResultProcessor.class);
    serverConnection.addIncoming(RemoteTestClassProcessor.class, this);
    serverConnection.connect();
}
Also used : TestResultProcessor(org.gradle.api.internal.tasks.testing.TestResultProcessor) ContextClassLoaderProxy(org.gradle.internal.dispatch.ContextClassLoaderProxy) ObjectConnection(org.gradle.internal.remote.ObjectConnection) TestClassProcessor(org.gradle.api.internal.tasks.testing.TestClassProcessor)

Aggregations

TestClassProcessor (org.gradle.api.internal.tasks.testing.TestClassProcessor)1 TestResultProcessor (org.gradle.api.internal.tasks.testing.TestResultProcessor)1 ContextClassLoaderProxy (org.gradle.internal.dispatch.ContextClassLoaderProxy)1 ObjectConnection (org.gradle.internal.remote.ObjectConnection)1