本文整理匯總了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();
}
示例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();
}
示例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();
}
}