Class CanonicalEventOrder

java.lang.Object
io.cucumber.core.plugin.CanonicalEventOrder
All Implemented Interfaces:
Comparator<Event>

final class CanonicalEventOrder extends Object implements Comparator<Event>
When pickles are executed in parallel events can be produced with a partial ordering.

The canonical order is the order in which these events would have been generated had cucumber executed these pickles in a serial fashion.

In canonical order events are ordered by type and time stamp:

  1. TestRunStarted
  2. TestSourceRead
  3. TestSourceParsed
  4. SnippetsSuggestedEvent
  5. StepDefinedEvent
  6. TestCaseEvent
  7. TestRunFinished

As part of ordering events by type, TestCaseEvents are ordered by

  1. uri
  2. line
  3. timestamp
  • Field Details

  • Constructor Details

    • CanonicalEventOrder

      CanonicalEventOrder()
  • Method Details

    • compare

      public int compare(Event a, Event b)
      Specified by:
      compare in interface Comparator<Event>
    • testCaseEvents

      private static int testCaseEvents(Event a, Event b)
    • testCaseLine

      private static int testCaseLine(TestCaseEvent o)
    • testCaseUri

      private static URI testCaseUri(TestCaseEvent o)
    • eventOrder

      private static int eventOrder(Event o)
    • findInFixedOrder

      private static int findInFixedOrder(Class<? extends Event> o)