當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。