@Test public void reports_uncaught_exceptions_from_actors_as_internal_errors() throws InterruptedException { createSuiteFactory(); BlockingQueue<String> spy = new LinkedBlockingQueue<>(); factory.start(new NullSuiteListener() { @Override public void onInternalError(String message, StackTrace cause) { spy.add(message); } }); ActorThread actorThread = factory.actors.startActorThread(); ActorRef<Runnable> dummyActor = actorThread.bindActor(Runnable.class, () -> { throw new RuntimeException("dummy exception"); }); dummyActor.tell().run(); assertThat(spy.take(), startsWith("Uncaught exception in thread jumi-actor-")); }
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);  }