当前位置: 首页>>代码示例>>Java>>正文


Java ReporterFactory类代码示例

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


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

示例1: invoke

import org.apache.maven.surefire.report.ReporterFactory; //导入依赖的package包/类
@Override
public RunResult invoke(Object forkTestSet) {
    ReporterFactory reporterFactory = providerParameters.getReporterFactory();
    RunListener listener = reporterFactory.createReporter();
    Runner runner = new Runner(tags);
    TestBlock rootBlock = runner.defineTests(getSuites());
    List<Reporter> reporters = Arrays.asList(new DefaultReporter(), new CuppaSurefireReporter(listener));
    runner.run(rootBlock, new CompositeReporter(reporters));
    return reporterFactory.close();
}
 
开发者ID:cuppa-framework,项目名称:cuppa,代码行数:11,代码来源:CuppaSurefireProvider.java

示例2: invoke

import org.apache.maven.surefire.report.ReporterFactory; //导入依赖的package包/类
@Override
public RunResult invoke(Object forkTestSet) throws TestSetFailedException,
        ReporterException, InvocationTargetException {
    if (forkTestSet == null) {
        RunResult r = RunResult.noTestsRun();
        @SuppressWarnings("rawtypes")
        Iterator<Class> i = getSuites();
        while (i.hasNext()) {
            r = r.aggregate(invoke(i.next()));
        }
        return r;
    }
    ReporterFactory reporterFactory = providerParameters
            .getReporterFactory();

    ConsoleLogger consoleLogger = providerParameters.getConsoleLogger();
    RunListener rl = reporterFactory.createReporter();

    if (!(forkTestSet instanceof Class)) {
        throw new TestSetFailedException(
                "Unexpected error. Received parameter is not a class");
    }
    @SuppressWarnings("unchecked")
    Class<T> underTest = (Class<T>) forkTestSet;
    TestResultListener<T> listener = new PowerUnitProviderListener<>(
            consoleLogger, rl, underTest);

    DefaultPowerUnitRunnerImpl<T> runner = new DefaultPowerUnitRunnerImpl<>(
            underTest);
    runner.addListener(listener);
    runner.run();
    return reporterFactory.close();

}
 
开发者ID:powerunit,项目名称:powerunit,代码行数:35,代码来源:PowerUnitProvider.java

示例3: invoke

import org.apache.maven.surefire.report.ReporterFactory; //导入依赖的package包/类
public RunResult invoke( Object forkTestSet )
    throws TestSetFailedException
{
    consoleLogger.info( "Play! initialization\n" );

    initializePlayEngine();
    try
    {
        upgradeCheck();

        ReporterFactory reporterFactory = providerParameters.getReporterFactory();

        RunResult runResult;
        try
        {
            RunListener reporter = reporterFactory.createReporter();

            startCapture( (ConsoleOutputReceiver) reporter );
            // startCapture() called in prior to setTestsToRun()

            if ( testsToRun == null )
            {
                setTestsToRun( forkTestSet );
            }

            Notifier notifier = new Notifier( new JUnit4RunListener( reporter ), getSkipAfterFailureCount() );
            Result result = new Result();
            notifier.addListeners( customRunListeners )
                .addListener( result.createListener() );

            if ( isFailFast() && commandsReader != null )
            {
                registerPleaseStopJUnitListener( notifier );
            }

            try
            {
                notifier.fireTestRunStarted( testsToRun.allowEagerReading()
                                                 ? createTestsDescription( testsToRun )
                                                 : createDescription( UNDETERMINED_TESTS_DESCRIPTION ) );

                if ( commandsReader != null )
                {
                    registerShutdownListener( testsToRun );
                    commandsReader.awaitStarted();
                }

                for ( Class<?> testToRun : testsToRun )
                {
                    executeTestSet( testToRun, reporter, notifier );
                }
            }
            finally
            {
                notifier.fireTestRunFinished( result );
                notifier.removeListeners();
            }
            rethrowAnyTestMechanismFailures( result );
        }
        finally
        {
            runResult = reporterFactory.close();
        }
        return runResult;
    }
    finally
    {
        consoleLogger.info( "Play! finalization\n" );
        finalizePlayEngine();
    }
}
 
开发者ID:play1-maven-plugin,项目名称:play1-maven-plugin,代码行数:72,代码来源:PlayJUnit4Provider.java


注:本文中的org.apache.maven.surefire.report.ReporterFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。