@Test public void sets_the_context_class_loader_for_test_threads() throws InterruptedException { createSuiteFactory(); factory.start(new NullSuiteListener()); BlockingQueue<ClassLoader> spy = new LinkedBlockingQueue<>(); factory.testThreadPool.execute(() -> { spy.add(Thread.currentThread().getContextClassLoader()); }); ClassLoader contextClassLoader = spy.take(); assertThat(contextClassLoader, is(factory.testClassLoader)); }
public void start(final SuiteListener suiteListener) { FailureHandler failureHandler = new InternalErrorReportingFailureHandler(suiteListener, logOutput); Executor testExecutor = messageListener.getListenedExecutor(testThreadPool); actors = new MultiThreadedActors( actorThreadPool, new ComposedEventizerProvider( new StartableEventizer(), new RunnableEventizer(), new WorkerListenerEventizer(), new TestFileFinderListenerEventizer(), new SuiteListenerEventizer(), new RequestListenerEventizer(), new RunListenerEventizer() ), failureHandler, messageListener ); ActorThread actorThread = actors.startActorThread(); ActorRef<TestFileFinderListener> suiteRunner = actorThread.bindActor(TestFileFinderListener.class, new SuiteRunner( new DriverFactory(suiteListener, actorThread, outputCapturer, driverFinder, runIdSequence, testClassLoader), suiteListener, actorThread, testExecutor, logOutput )); suiteListener.onSuiteStarted(); actorThreadPool.execute(new TestFileFinderRunner(testFileFinder, suiteRunner)); }
SuiteFactory implements AutoCloseable { public void start(final SuiteListener suiteListener) { FailureHandler failureHandler = new InternalErrorReportingFailureHandler(suiteListener, logOutput); Executor testExecutor = messageListener.getListenedExecutor(testThreadPool); actors = new MultiThreadedActors( actorThreadPool, new ComposedEventizerProvider( new StartableEventizer(), new RunnableEventizer(), new WorkerListenerEventizer(), new TestFileFinderListenerEventizer(), new SuiteListenerEventizer(), new RequestListenerEventizer(), new RunListenerEventizer() ), failureHandler, messageListener ); ActorThread actorThread = actors.startActorThread(); ActorRef<TestFileFinderListener> suiteRunner = actorThread.bindActor(TestFileFinderListener.class, new SuiteRunner( new DriverFactory(suiteListener, actorThread, outputCapturer, driverFinder, runIdSequence, testClassLoader), suiteListener, actorThread, testExecutor, logOutput )); suiteListener.onSuiteStarted(); actorThreadPool.execute(new TestFileFinderRunner(testFileFinder, suiteRunner)); } }
SuiteFactory implements AutoCloseable { public void start(final SuiteListener suiteListener) { FailureHandler failureHandler = new InternalErrorReportingFailureHandler(suiteListener, logOutput); Executor testExecutor = messageListener.getListenedExecutor(testThreadPool); actors = new MultiThreadedActors( actorThreadPool, new ComposedEventizerProvider( new StartableEventizer(), new RunnableEventizer(), new WorkerListenerEventizer(), new TestFileFinderListenerEventizer(), new SuiteListenerEventizer(), new RequestListenerEventizer(), new RunListenerEventizer() ), failureHandler, messageListener ); ActorThread actorThread = actors.startActorThread(); ActorRef<TestFileFinderListener> suiteRunner = actorThread.bindActor(TestFileFinderListener.class, new SuiteRunner( new DriverFactory(suiteListener, actorThread, outputCapturer, driverFinder, runIdSequence, testClassLoader), suiteListener, actorThread, testExecutor, logOutput )); suiteListener.onSuiteStarted(); actorThreadPool.execute(new TestFileFinderRunner(testFileFinder, suiteRunner)); } SuiteFactory(DaemonConfiguration daemonConfiguration, OutputCapturer outputCapturer, PrintStream logOutput, MessageListener messageListener); }
SuiteFactory implements AutoCloseable { public void start(final SuiteListener suiteListener) { FailureHandler failureHandler = new InternalErrorReportingFailureHandler(suiteListener, logOutput); Executor testExecutor = messageListener.getListenedExecutor(testThreadPool); actors = new MultiThreadedActors( actorThreadPool, new ComposedEventizerProvider( new StartableEventizer(), new RunnableEventizer(), new WorkerListenerEventizer(), new TestFileFinderListenerEventizer(), new SuiteListenerEventizer(), new RequestListenerEventizer(), new RunListenerEventizer() ), failureHandler, messageListener ); ActorThread actorThread = actors.startActorThread(); ActorRef<TestFileFinderListener> suiteRunner = actorThread.bindActor(TestFileFinderListener.class, new SuiteRunner( new DriverFactory(suiteListener, actorThread, outputCapturer, driverFinder, runIdSequence, testClassLoader), suiteListener, actorThread, testExecutor, logOutput )); suiteListener.onSuiteStarted(); actorThreadPool.execute(new TestFileFinderRunner(testFileFinder, suiteRunner)); } SuiteFactory(DaemonConfiguration daemonConfiguration, OutputCapturer outputCapturer, PrintStream logOutput, MessageListener messageListener); void configure(SuiteConfiguration suite); void start(final SuiteListener suiteListener); @Override void close(); static List<Path> getClassDirectories(SuiteConfiguration suite); }
SuiteFactory implements AutoCloseable { public void start(final SuiteListener suiteListener) { FailureHandler failureHandler = new InternalErrorReportingFailureHandler(suiteListener, logOutput); Executor testExecutor = messageListener.getListenedExecutor(testThreadPool); actors = new MultiThreadedActors( actorThreadPool, new ComposedEventizerProvider( new StartableEventizer(), new RunnableEventizer(), new WorkerListenerEventizer(), new TestFileFinderListenerEventizer(), new SuiteListenerEventizer(), new RequestListenerEventizer(), new RunListenerEventizer() ), failureHandler, messageListener ); ActorThread actorThread = actors.startActorThread(); ActorRef<TestFileFinderListener> suiteRunner = actorThread.bindActor(TestFileFinderListener.class, new SuiteRunner( new DriverFactory(suiteListener, actorThread, outputCapturer, driverFinder, runIdSequence, testClassLoader), suiteListener, actorThread, testExecutor, logOutput )); suiteListener.onSuiteStarted(); actorThreadPool.execute(new TestFileFinderRunner(testFileFinder, suiteRunner)); } SuiteFactory(DaemonConfiguration daemonConfiguration, OutputCapturer outputCapturer, PrintStream logOutput, MessageListener messageListener); void configure(SuiteConfiguration suite); void start(final SuiteListener suiteListener); @Override void close(); static List<Path> getClassDirectories(SuiteConfiguration suite);  }