Interface ConcurrentEventListener

All Superinterfaces:
Plugin

@API(status=STABLE) public interface ConcurrentEventListener extends Plugin
Listens to pickle execution events. Can be used to implement reporters.

When cucumber executes test in parallel or in a framework that supports parallel execution (e.g. JUnit or TestNG) TestCase events from different pickles may interleave.

This interface marks an EventListener as capable of understanding interleaved pickle events.

While running tests in parallel cucumber makes the following guarantees:

  1. The event publisher is synchronized. Events are not published concurrently.
  2. For test cases executed on different threads a callback registered on the event publisher will be called by different threads. I.e. Thread.currentThread() will return a different thread for two test cases executed on a different thread (but not necessarily the executing thread).
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Set the event publisher.
  • Method Details

    • setEventPublisher

      void setEventPublisher(EventPublisher publisher)
      Set the event publisher. The plugin can register event listeners with the publisher.
      Parameters:
      publisher - the event publisher