Java 类org.gradle.api.internal.tasks.testing.TestClassProcessor 实例源码

项目:Reer    文件:MaxNParallelTestClassProcessor.java   
@Override
public void processTestClass(TestClassRunInfo testClass) {
    TestClassProcessor processor;
    if (processors.size() < maxProcessors) {
        processor = factory.create();
        Actor actor = actorFactory.createActor(processor);
        processor = actor.getProxy(TestClassProcessor.class);
        actors.add(actor);
        processors.add(processor);
        processor.startProcessing(resultProcessor);
    } else {
        processor = processors.get(pos);
        pos = (pos + 1) % processors.size();
    }
    processor.processTestClass(testClass);
}
项目:Reer    文件:TestWorker.java   
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();
}
项目:Pushjet-Android    文件:TestWorker.java   
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(), new TrueTimeProvider());
    ContextClassLoaderProxy<TestClassProcessor> proxy = new ContextClassLoaderProxy<TestClassProcessor>(
            TestClassProcessor.class, targetProcessor, workerProcessContext.getApplicationClassLoader());
    processor = proxy.getSource();

    ObjectConnection serverConnection = workerProcessContext.getServerConnection();
    serverConnection.useParameterSerializer(new TestEventSerializer());
    this.resultProcessor = serverConnection.addOutgoing(TestResultProcessor.class);
    serverConnection.addIncoming(RemoteTestClassProcessor.class, this);
    serverConnection.connect();
}
项目:Pushjet-Android    文件:TestWorker.java   
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(), new TrueTimeProvider());
    ContextClassLoaderProxy<TestClassProcessor> proxy = new ContextClassLoaderProxy<TestClassProcessor>(
            TestClassProcessor.class, targetProcessor, workerProcessContext.getApplicationClassLoader());
    processor = proxy.getSource();

    ObjectConnection serverConnection = workerProcessContext.getServerConnection();
    serverConnection.useParameterSerializer(new TestEventSerializer());
    this.resultProcessor = serverConnection.addOutgoing(TestResultProcessor.class);
    serverConnection.addIncoming(RemoteTestClassProcessor.class, this);
    serverConnection.connect();
}
项目:Reer    文件:DefaultTestExecuter.java   
@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();
}
项目:Pushjet-Android    文件:MaxNParallelTestClassProcessor.java   
public void processTestClass(TestClassRunInfo testClass) {
    TestClassProcessor processor;
    if (processors.size() < maxProcessors) {
        processor = factory.create();
        Actor actor = actorFactory.createActor(processor);
        processor = actor.getProxy(TestClassProcessor.class);
        actors.add(actor);
        processors.add(processor);
        processor.startProcessing(resultProcessor);
    } else {
        processor = processors.get(pos);
        pos = (pos + 1) % processors.size();
    }
    processor.processTestClass(testClass);
}
项目:Pushjet-Android    文件:DefaultTestExecuter.java   
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();
}
项目:Pushjet-Android    文件:MaxNParallelTestClassProcessor.java   
public void processTestClass(TestClassRunInfo testClass) {
    TestClassProcessor processor;
    if (processors.size() < maxProcessors) {
        processor = factory.create();
        Actor actor = actorFactory.createActor(processor);
        processor = actor.getProxy(TestClassProcessor.class);
        actors.add(actor);
        processors.add(processor);
        processor.startProcessing(resultProcessor);
    } else {
        processor = processors.get(pos);
        pos = (pos + 1) % processors.size();
    }
    processor.processTestClass(testClass);
}
项目:Pushjet-Android    文件:DefaultTestExecuter.java   
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();
}
项目:Reer    文件:RestartEveryNTestClassProcessor.java   
public RestartEveryNTestClassProcessor(Factory<TestClassProcessor> factory, long restartEvery) {
    this.factory = factory;
    this.restartEvery = restartEvery;
}
项目:Reer    文件:MaxNParallelTestClassProcessor.java   
public MaxNParallelTestClassProcessor(int maxProcessors, Factory<TestClassProcessor> factory, ActorFactory actorFactory) {
    this.maxProcessors = maxProcessors;
    this.factory = factory;
    this.actorFactory = actorFactory;
}
项目:Reer    文件:TestNGTestFramework.java   
@Override
public TestClassProcessor create(ServiceRegistry serviceRegistry) {
    return new TestNGTestClassProcessor(testReportDir, options, suiteFiles, serviceRegistry.get(IdGenerator.class), serviceRegistry.get(TimeProvider.class), serviceRegistry.get(ActorFactory.class));
}
项目:Reer    文件:JUnitTestFramework.java   
@Override
public TestClassProcessor create(ServiceRegistry serviceRegistry) {
    return new JUnitTestClassProcessor(spec, serviceRegistry.get(IdGenerator.class), serviceRegistry.get(ActorFactory.class), serviceRegistry.get(TimeProvider.class));
}
项目:Reer    文件:DefaultTestClassScanner.java   
public DefaultTestClassScanner(FileTree candidateClassFiles, TestFrameworkDetector testFrameworkDetector,
                               TestClassProcessor testClassProcessor) {
    this.candidateClassFiles = candidateClassFiles;
    this.testFrameworkDetector = testFrameworkDetector;
    this.testClassProcessor = testClassProcessor;
}
项目:Reer    文件:AbstractTestFrameworkDetector.java   
@Override
public void startDetection(TestClassProcessor testClassProcessor) {
    this.testClassProcessor = testClassProcessor;
}
项目:ide-plugins    文件:EclipsePluginTestClassScanner.java   
public EclipsePluginTestClassScanner(FileTree candidateClassFiles, TestClassProcessor testClassProcessor) {
    this.candidateClassFiles = candidateClassFiles;
    this.testClassProcessor = testClassProcessor;
}
项目:gradle-dockerized-test-plugin    文件:TestExecuter.java   
@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();
}
项目:Pushjet-Android    文件:TestNGTestFramework.java   
public TestClassProcessor create(ServiceRegistry serviceRegistry) {
    return new TestNGTestClassProcessor(testReportDir, options, suiteFiles,
            serviceRegistry.get(IdGenerator.class), new JULRedirector());
}
项目:Pushjet-Android    文件:JUnitTestFramework.java   
public TestClassProcessor create(ServiceRegistry serviceRegistry) {
    return new JUnitTestClassProcessor(spec, serviceRegistry.get(IdGenerator.class), serviceRegistry.get(ActorFactory.class), new JULRedirector());
}
项目:Pushjet-Android    文件:RestartEveryNTestClassProcessor.java   
public RestartEveryNTestClassProcessor(Factory<TestClassProcessor> factory, long restartEvery) {
    this.factory = factory;
    this.restartEvery = restartEvery;
}
项目:Pushjet-Android    文件:MaxNParallelTestClassProcessor.java   
public MaxNParallelTestClassProcessor(int maxProcessors, Factory<TestClassProcessor> factory, ActorFactory actorFactory) {
    this.maxProcessors = maxProcessors;
    this.factory = factory;
    this.actorFactory = actorFactory;
}
项目:Pushjet-Android    文件:TestMainAction.java   
public TestMainAction(Runnable detector, TestClassProcessor processor, TestResultProcessor resultProcessor, TimeProvider timeProvider) {
    this.detector = detector;
    this.processor = processor;
    this.resultProcessor = new AttachParentTestResultProcessor(resultProcessor);
    this.timeProvider = timeProvider;
}
项目:Pushjet-Android    文件:DefaultTestClassScanner.java   
public DefaultTestClassScanner(FileTree candidateClassFiles, TestFrameworkDetector testFrameworkDetector,
                               TestClassProcessor testClassProcessor) {
    this.candidateClassFiles = candidateClassFiles;
    this.testFrameworkDetector = testFrameworkDetector;
    this.testClassProcessor = testClassProcessor;
}
项目:Pushjet-Android    文件:AbstractTestFrameworkDetector.java   
public void startDetection(TestClassProcessor testClassProcessor) {
    this.testClassProcessor = testClassProcessor;
}
项目:Pushjet-Android    文件:TestNGTestFramework.java   
public TestClassProcessor create(ServiceRegistry serviceRegistry) {
    return new TestNGTestClassProcessor(testReportDir, options, suiteFiles,
            serviceRegistry.get(IdGenerator.class), new JULRedirector());
}
项目:Pushjet-Android    文件:JUnitTestFramework.java   
public TestClassProcessor create(ServiceRegistry serviceRegistry) {
    return new JUnitTestClassProcessor(spec, serviceRegistry.get(IdGenerator.class), serviceRegistry.get(ActorFactory.class), new JULRedirector());
}
项目:Pushjet-Android    文件:RestartEveryNTestClassProcessor.java   
public RestartEveryNTestClassProcessor(Factory<TestClassProcessor> factory, long restartEvery) {
    this.factory = factory;
    this.restartEvery = restartEvery;
}
项目:Pushjet-Android    文件:MaxNParallelTestClassProcessor.java   
public MaxNParallelTestClassProcessor(int maxProcessors, Factory<TestClassProcessor> factory, ActorFactory actorFactory) {
    this.maxProcessors = maxProcessors;
    this.factory = factory;
    this.actorFactory = actorFactory;
}
项目:Pushjet-Android    文件:TestMainAction.java   
public TestMainAction(Runnable detector, TestClassProcessor processor, TestResultProcessor resultProcessor, TimeProvider timeProvider) {
    this.detector = detector;
    this.processor = processor;
    this.resultProcessor = new AttachParentTestResultProcessor(resultProcessor);
    this.timeProvider = timeProvider;
}
项目:Pushjet-Android    文件:DefaultTestClassScanner.java   
public DefaultTestClassScanner(FileTree candidateClassFiles, TestFrameworkDetector testFrameworkDetector,
                               TestClassProcessor testClassProcessor) {
    this.candidateClassFiles = candidateClassFiles;
    this.testFrameworkDetector = testFrameworkDetector;
    this.testClassProcessor = testClassProcessor;
}
项目:Pushjet-Android    文件:AbstractTestFrameworkDetector.java   
public void startDetection(TestClassProcessor testClassProcessor) {
    this.testClassProcessor = testClassProcessor;
}
项目:Reer    文件:TestFrameworkDetector.java   
void startDetection(TestClassProcessor testClassProcessor);
项目:Pushjet-Android    文件:TestFrameworkDetector.java   
void startDetection(TestClassProcessor testClassProcessor);
项目:Pushjet-Android    文件:TestFrameworkDetector.java   
void startDetection(TestClassProcessor testClassProcessor);