private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private Runner parallelize( Runner runner, RunnerScheduler runnerInterceptor ) { if ( runner instanceof ParentRunner<?> ) { ( (ParentRunner<?>) runner ).setScheduler( runnerInterceptor ); } return runner; }
private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private static Runner parallelize(Runner runner) { if (runner instanceof ParentRunner) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final ExecutorService fService = Executors.newCachedThreadPool(); public void schedule(Runnable childStatement) { fService.submit(childStatement); } public void finished() { try { fService.shutdown(); fService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { e.printStackTrace(System.err); } } }); } return runner; }
private static <T> Runner parallelize(Runner runner) { if (runner instanceof ParentRunner<?>) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final List<Future<Object>> fResults = new ArrayList<Future<Object>>();
private static <T> Runner parallelize(Runner runner) { if (runner instanceof ParentRunner<?>) { ((ParentRunner<?>) runner).setScheduler(new RunnerScheduler() { private final List<Future<Object>> fResults = new ArrayList<Future<Object>>();
@Override protected Runner getRunner( RunnerBuilder builder, Class<?> testClass ) throws Throwable { Runner runner = super.getRunner( builder, testClass ); if ( canSchedule( runner ) ) { if ( !isThreadSafe( runner ) ) { ( ( ParentRunner ) runner ).setScheduler( notThreadSafeTests.newRunnerScheduler() ); notParallelRunners.add( runner ); } else if ( runner instanceof Suite ) { suites.add( (Suite) runner ); } else { classes.add( (ParentRunner) runner ); } } else { notParallelRunners.add( runner ); } return runner; }
@Override public void apply( Object child ) throws NoTestsRemainException { super.apply( child ); if ( child instanceof ParentRunner ) { ParentRunner runner = ( ParentRunner ) child; if ( !isThreadSafe( runner ) ) { runner.setScheduler( notThreadSafeTests.newRunnerScheduler() ); } else if ( child instanceof Suite ) { nestedSuites.add( (Suite) child ); } else { ParentRunner parentRunner = (ParentRunner) child; nestedClasses.add( parentRunner ); nestedClassesChildren += parentRunner.getDescription().getChildren().size(); } } }
suiteSuites.setScheduler( createScheduler( null, commonPool, true, balancer ) ); suiteSuites.setScheduler( createScheduler( parallelSuites ) ); Arrays.<Runner>asList( suiteSuites, suiteClasses, createSuite( notParallelRunners ) ) ) ); all.setScheduler( master ); return all;
for ( ParentRunner runner : runners ) runner.setScheduler( createScheduler( runner.getDescription(), commonPool, doParallel, concurrencyLimit ) ); for ( ParentRunner runner : runners ) runner.setScheduler( createScheduler( runner.getDescription(), pool, doParallel, BalancerFactory.createInfinitePermitsBalancer() ) );
if (runner instanceof ParentRunner) { ParentRunner<?> parentRunner = (ParentRunner<?>) runner; parentRunner.setScheduler(new RunnerScheduler() { public void schedule(Runnable childStatement) { if (textListener.getLastFailure() == null) {