use of org.gradle.internal.remote.ObjectConnection in project gradle by gradle.
the class ForkingTestClassProcessor method forkProcess.
RemoteTestClassProcessor forkProcess() {
WorkerProcessBuilder builder = workerFactory.create(new TestWorker(processorFactory));
builder.setBaseName("Gradle Test Executor");
builder.setImplementationClasspath(getTestWorkerImplementationClasspath());
builder.applicationClasspath(classPath);
options.copyTo(builder.getJavaCommand());
buildConfigAction.execute(builder);
workerProcess = builder.build();
workerProcess.start();
ObjectConnection connection = workerProcess.getConnection();
connection.useParameterSerializers(TestEventSerializer.create());
connection.addIncoming(TestResultProcessor.class, resultProcessor);
RemoteTestClassProcessor remoteProcessor = connection.addOutgoing(RemoteTestClassProcessor.class);
connection.connect();
remoteProcessor.startProcessing();
return remoteProcessor;
}
use of org.gradle.internal.remote.ObjectConnection 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();
}
Aggregations