public static RunResult invokeProvider( Object testSet, ClassLoader testsClassLoader, Object factory, ProviderConfiguration providerConfiguration, boolean insideFork, StartupConfiguration startupConfig, boolean restoreStreams ) throws TestSetFailedException, InvocationTargetException { final PrintStream orgSystemOut = System.out; final PrintStream orgSystemErr = System.err; // Note that System.out/System.err are also read in the "ReporterConfiguration" instantiation // in createProvider below. These are the same values as here. try { return new ProviderFactory( startupConfig, providerConfiguration, testsClassLoader, factory ) .createProvider( insideFork ) .invoke( testSet ); } finally { if ( restoreStreams && System.getSecurityManager() == null ) { System.setOut( orgSystemOut ); System.setErr( orgSystemErr ); } } }
private Iterable<Class<?>> getSuitesIterator() throws SurefireBooterForkException { try { AbstractPathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration(); ClassLoader unifiedClassLoader = classpathConfiguration.createMergedClassLoader(); CommonReflector commonReflector = new CommonReflector( unifiedClassLoader ); Object reporterFactory = commonReflector.createReportingReporterFactory( startupReportConfiguration, log ); ProviderFactory providerFactory = new ProviderFactory( startupConfiguration, providerConfiguration, unifiedClassLoader, reporterFactory ); SurefireProvider surefireProvider = providerFactory.createProvider( false ); return surefireProvider.getSuites(); } catch ( SurefireExecutionException e ) { throw new SurefireBooterForkException( "Unable to create classloader to find test suites", e ); } }
private Iterable<Class<?>> getSuitesIterator() throws SurefireBooterForkException { try { AbstractPathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration(); ClassLoader unifiedClassLoader = classpathConfiguration.createMergedClassLoader(); CommonReflector commonReflector = new CommonReflector( unifiedClassLoader ); Object reporterFactory = commonReflector.createReportingReporterFactory( startupReportConfiguration, log ); ProviderFactory providerFactory = new ProviderFactory( startupConfiguration, providerConfiguration, unifiedClassLoader, reporterFactory ); SurefireProvider surefireProvider = providerFactory.createProvider( false ); return surefireProvider.getSuites(); } catch ( SurefireExecutionException e ) { throw new SurefireBooterForkException( "Unable to create classloader to find test suites", e ); } }