本文整理汇总了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();
}
}