• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TestResultProcessor类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.gradle.api.internal.tasks.testing.TestResultProcessor的典型用法代码示例。如果您正苦于以下问题:Java TestResultProcessor类的具体用法?Java TestResultProcessor怎么用?Java TestResultProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TestResultProcessor类属于org.gradle.api.internal.tasks.testing包,在下文中一共展示了TestResultProcessor类的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startReceivingTests

点赞 3

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
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();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:17,
代码来源:TestWorker.java

示例2: forkProcess

点赞 3

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
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;
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:20,
代码来源:ForkingTestClassProcessor.java

示例3: startProcessing

点赞 3

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@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);
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:17,
代码来源:JUnitTestClassProcessor.java

示例4: forkProcess

点赞 3

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
RemoteTestClassProcessor forkProcess() {
    WorkerProcessBuilder builder = workerFactory.create(new ForciblyStoppableTestWorker(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;
}
 

开发者ID:pedjak,
项目名称:gradle-dockerized-test-plugin,
代码行数:20,
代码来源:ForkingTestClassProcessor.java

示例5: startReceivingTests

点赞 3

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
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();
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:17,
代码来源:TestWorker.java

示例6: forkProcess

点赞 3

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
RemoteTestClassProcessor forkProcess() {
    WorkerProcessBuilder builder = workerFactory.create();
    builder.setBaseName("Gradle Test Executor");
    builder.applicationClasspath(classPath);
    builder.setLoadApplicationInSystemClassLoader(true);
    builder.worker(new TestWorker(processorFactory));
    options.copyTo(builder.getJavaCommand());
    buildConfigAction.execute(builder);

    workerProcess = builder.build();
    workerProcess.start();

    ObjectConnection connection = workerProcess.getConnection();
    connection.useParameterSerializer(new TestEventSerializer());
    connection.addIncoming(TestResultProcessor.class, resultProcessor);
    RemoteTestClassProcessor remoteProcessor = connection.addOutgoing(RemoteTestClassProcessor.class);
    connection.connect();
    remoteProcessor.startProcessing();
    return remoteProcessor;
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:21,
代码来源:ForkingTestClassProcessor.java

示例7: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@Override
public void startProcessing(TestResultProcessor resultProcessor) {
    // Wrap the processor in an actor, to make it thread-safe
    resultProcessorActor = actorFactory.createBlockingActor(resultProcessor);
    this.resultProcessor = resultProcessorActor.getProxy(TestResultProcessor.class);
    applicationClassLoader = Thread.currentThread().getContextClassLoader();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:8,
代码来源:TestNGTestClassProcessor.java

示例8: execute

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@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();
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:38,
代码来源:DefaultTestExecuter.java

示例9: execute

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@Override
public void execute(Test test, TestResultProcessor testResultProcessor) {
    LOGGER.info("Executing tests in Eclipse");

    int pdeTestPort = new PDETestPortLocator().locatePDETestPortNumber();
    if (pdeTestPort == -1) {
        throw new GradleException("Cannot allocate port for PDE test run");
    }
    LOGGER.info("Will use port {} to communicate with Eclipse.", pdeTestPort);

    runPDETestsInEclipse(test, testResultProcessor, pdeTestPort);
}
 

开发者ID:gluonhq,
项目名称:ide-plugins,
代码行数:13,
代码来源:EclipseTestExecuter.java

示例10: EclipseTestListener

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public EclipseTestListener(TestResultProcessor testResultProcessor, String suite, Object waitMonitor, Object testTaskOperationId, Object rootTestSuiteId) {
    this.resultProcessor = new AttachParentTestResultProcessor(testResultProcessor);
    this.waitMonitor = waitMonitor;
    this.suiteName = suite;
    this.testTaskOperationId = testTaskOperationId;
    this.rootTestSuiteId = rootTestSuiteId;
}
 

开发者ID:gluonhq,
项目名称:ide-plugins,
代码行数:8,
代码来源:EclipseTestListener.java

示例11: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public void startProcessing(TestResultProcessor resultProcessor) {
    // Build a result processor chain
    ClassLoader applicationClassLoader = Thread.currentThread().getContextClassLoader();
    TestResultProcessor resultProcessorChain = new AttachParentTestResultProcessor(new CaptureTestOutputTestResultProcessor(resultProcessor, outputRedirector));
    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);
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:16,
代码来源:JUnitTestClassProcessor.java

示例12: execute

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
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();
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:32,
代码来源:DefaultTestExecuter.java

示例13: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@Override
public void startProcessing(TestResultProcessor resultProcessor) {
    this.resultProcessor = resultProcessor;
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:5,
代码来源:RestartEveryNTestClassProcessor.java

示例14: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@Override
public void startProcessing(TestResultProcessor resultProcessor) {
    // Create a processor that processes events in its own thread
    resultProcessorActor = actorFactory.createActor(resultProcessor);
    this.resultProcessor = resultProcessorActor.getProxy(TestResultProcessor.class);
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:7,
代码来源:MaxNParallelTestClassProcessor.java

示例15: CaptureTestOutputTestResultProcessor

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public CaptureTestOutputTestResultProcessor(TestResultProcessor processor, StandardOutputRedirector outputRedirector) {
    this(processor, new TestOutputRedirector(processor, outputRedirector));
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:4,
代码来源:CaptureTestOutputTestResultProcessor.java

示例16: TestOutputRedirector

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
TestOutputRedirector(TestResultProcessor processor, StandardOutputRedirector redirector) {
    this.redirector = redirector;
    this.outForwarder = new Forwarder(processor, TestOutputEvent.Destination.StdOut);
    this.errForwarder = new Forwarder(processor, TestOutputEvent.Destination.StdErr);
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:6,
代码来源:TestOutputRedirector.java

示例17: Forwarder

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public Forwarder(TestResultProcessor processor, TestOutputEvent.Destination dest) {
    this.processor = processor;
    this.dest = dest;
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:5,
代码来源:TestOutputRedirector.java

示例18: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@Override
public void startProcessing(TestResultProcessor testResultProcessor) {
    // no-op
}
 

开发者ID:gluonhq,
项目名称:ide-plugins,
代码行数:5,
代码来源:EclipseTestExecuter.java

示例19: JovialOutputHandler

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public JovialOutputHandler(FileCollection classpath, Pipe pipe, TestResultProcessor testResultProcessor) {
    this.classpath = classpath;
    this.pipe = pipe;
    this.testResultProcessor = testResultProcessor;
}
 

开发者ID:ajoberstar,
项目名称:jovial,
代码行数:6,
代码来源:JovialTestExecuter.java

示例20: execute

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@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();
}
 

开发者ID:pedjak,
项目名称:gradle-dockerized-test-plugin,
代码行数:44,
代码来源:TestExecuter.java

示例21: executeTests

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@TaskAction
public void executeTests() {
    LogLevel currentLevel = getCurrentLogLevel();
    TestLogging levelLogging = testLogging.get(currentLevel);
    TestExceptionFormatter exceptionFormatter = getExceptionFormatter(levelLogging);
    TestEventLogger eventLogger = new TestEventLogger(getTextOutputFactory(), currentLevel, levelLogging, exceptionFormatter);
    addTestListener(eventLogger);
    addTestOutputListener(eventLogger);
    if (!getFilter().getIncludePatterns().isEmpty()) {
        addTestListener(new NoMatchingTestsReporter("No tests found for given includes: " + getFilter().getIncludePatterns()));
    }

    File binaryResultsDir = getBinResultsDir();
    getProject().delete(binaryResultsDir);
    getProject().mkdir(binaryResultsDir);

    Map<String, TestClassResult> results = new HashMap<String, TestClassResult>();
    TestOutputStore testOutputStore = new TestOutputStore(binaryResultsDir);

    TestOutputStore.Writer outputWriter = testOutputStore.writer();
    TestReportDataCollector testReportDataCollector = new TestReportDataCollector(results, outputWriter);

    addTestListener(testReportDataCollector);
    addTestOutputListener(testReportDataCollector);

    TestCountLogger testCountLogger = new TestCountLogger(getProgressLoggerFactory());
    addTestListener(testCountLogger);

    TestResultProcessor resultProcessor = new TestListenerAdapter(
            getTestListenerBroadcaster().getSource(), testOutputListenerBroadcaster.getSource());

    if (testExecuter == null) {
        testExecuter = new DefaultTestExecuter(getProcessBuilderFactory(), getActorFactory());
    }

    try {
        testExecuter.execute(this, resultProcessor);
    } finally {
        testExecuter = null;
        testListenerBroadcaster.removeAll();
        testOutputListenerBroadcaster.removeAll();
        outputWriter.close();
    }

    new TestResultSerializer(binaryResultsDir).write(results.values());

    TestResultsProvider testResultsProvider = new InMemoryTestResultsProvider(results.values(), testOutputStore.reader());

    try {
        if (testReporter == null) {
            testReporter = new DefaultTestReport();
        }

        JUnitXmlReport junitXml = reports.getJunitXml();
        if (junitXml.isEnabled()) {
            TestOutputAssociation outputAssociation = junitXml.isOutputPerTestCase()
                    ? TestOutputAssociation.WITH_TESTCASE
                    : TestOutputAssociation.WITH_SUITE;
            Binary2JUnitXmlReportGenerator binary2JUnitXmlReportGenerator = new Binary2JUnitXmlReportGenerator(junitXml.getDestination(), testResultsProvider, outputAssociation);
            binary2JUnitXmlReportGenerator.generate();
        }

        DirectoryReport html = reports.getHtml();
        if (!html.isEnabled()) {
            getLogger().info("Test report disabled, omitting generation of the HTML test report.");
        } else {
            testReporter.generateReport(testResultsProvider, html.getDestination());
        }
    } finally {
        CompositeStoppable.stoppable(testResultsProvider).stop();
        testReporter = null;
        testFramework = null;
    }

    if (testCountLogger.hadFailures()) {
        handleTestFailures();
    }
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:79,
代码来源:Test.java

示例22: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public void startProcessing(TestResultProcessor resultProcessor) {
    this.resultProcessor = resultProcessor;
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:4,
代码来源:RestartEveryNTestClassProcessor.java

示例23: startProcessing

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public void startProcessing(TestResultProcessor resultProcessor) {
    resultProcessorActor = actorFactory.createActor(resultProcessor);
    this.resultProcessor = resultProcessorActor.getProxy(TestResultProcessor.class);
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:5,
代码来源:MaxNParallelTestClassProcessor.java

示例24: executeTests

点赞 2

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
@TaskAction
public void executeTests() {
    LogLevel currentLevel = getCurrentLogLevel();
    TestLogging levelLogging = testLogging.get(currentLevel);
    TestExceptionFormatter exceptionFormatter = getExceptionFormatter(levelLogging);
    TestEventLogger eventLogger = new TestEventLogger(textOutputFactory, currentLevel, levelLogging, exceptionFormatter);
    addTestListener(eventLogger);
    addTestOutputListener(eventLogger);
    if (!getFilter().getIncludePatterns().isEmpty()) {
        addTestListener(new NoMatchingTestsReporter("No tests found for given includes: " + getFilter().getIncludePatterns()));
    }

    File binaryResultsDir = getBinResultsDir();
    getProject().delete(binaryResultsDir);
    getProject().mkdir(binaryResultsDir);

    Map<String, TestClassResult> results = new HashMap<String, TestClassResult>();
    TestOutputStore testOutputStore = new TestOutputStore(binaryResultsDir);

    TestOutputStore.Writer outputWriter = testOutputStore.writer();
    TestReportDataCollector testReportDataCollector = new TestReportDataCollector(results, outputWriter);

    addTestListener(testReportDataCollector);
    addTestOutputListener(testReportDataCollector);

    TestCountLogger testCountLogger = new TestCountLogger(progressLoggerFactory);
    addTestListener(testCountLogger);

    TestResultProcessor resultProcessor = new TestListenerAdapter(
            getTestListenerBroadcaster().getSource(), testOutputListenerBroadcaster.getSource());

    try {
        testExecuter.execute(this, resultProcessor);
    } finally {
        testListenerBroadcaster.removeAll();
        testOutputListenerBroadcaster.removeAll();
        outputWriter.close();
    }

    new TestResultSerializer(binaryResultsDir).write(results.values());

    TestResultsProvider testResultsProvider = new InMemoryTestResultsProvider(results.values(), testOutputStore.reader());

    try {
        JUnitXmlReport junitXml = reports.getJunitXml();
        if (junitXml.isEnabled()) {
            TestOutputAssociation outputAssociation = junitXml.isOutputPerTestCase()
                    ? TestOutputAssociation.WITH_TESTCASE
                    : TestOutputAssociation.WITH_SUITE;
            Binary2JUnitXmlReportGenerator binary2JUnitXmlReportGenerator = new Binary2JUnitXmlReportGenerator(junitXml.getDestination(), testResultsProvider, outputAssociation);
            binary2JUnitXmlReportGenerator.generate();
        }

        DirectoryReport html = reports.getHtml();
        if (!html.isEnabled()) {
            getLogger().info("Test report disabled, omitting generation of the HTML test report.");
        } else {
            testReporter.generateReport(testResultsProvider, html.getDestination());
        }
    } finally {
        CompositeStoppable.stoppable(testResultsProvider).stop();
    }

    testFramework = null;

    if (testCountLogger.hadFailures()) {
        handleTestFailures();
    }
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:70,
代码来源:Test.java

示例25: startProcessing

点赞 1

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
public void startProcessing(TestResultProcessor resultProcessor) {
    TestResultProcessor resultProcessorChain = new CaptureTestOutputTestResultProcessor(resultProcessor, outputRedirector);

    testResultProcessor = new TestNGTestResultProcessorAdapter(resultProcessorChain, idGenerator);

    applicationClassLoader = Thread.currentThread().getContextClassLoader();
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:8,
代码来源:TestNGTestClassProcessor.java

示例26: execute

点赞 1

import org.gradle.api.internal.tasks.testing.TestResultProcessor; //导入依赖的package包/类
void execute(Test testTask, TestResultProcessor testResultProcessor); 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:2,
代码来源:TestExecuter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)