Class ReinterpretedOutlines

java.lang.Object
com.arc_e_tect.gradle.gherkin.progress.ReinterpretedOutlines

public final class ReinterpretedOutlines extends Object
Finds the Scenario Outlines whose persisted progress history this run's expansion of outlines - one scenario per Examples row, rather than one per outline (see FeatureParser) - has just superseded.

An outline that used to be reported once carried one history record, keyed on the outline's own title. Once its rows are reported individually, that title is no longer any scenario's title, so its record stops being seen and ProgressHistoryUpdater marks it removed, while each row starts a record of its own. Nothing about the feature files changed - only how they're read - so the report says so rather than leaving a reader to conclude that a scenario was deleted and several new ones written.

An outline is only reported here on the single run that actually re-interprets it. All three of the following must hold, which they can't again once that run has persisted its history:

  • the outline's own title has a record in the previously persisted history - so an outline first written after this behaviour shipped is never mentioned;
  • that record is not already marked removed - so the run after the re-interpreting one, which still finds the same record sitting in the history file, stays quiet;
  • no scenario in the current run still carries that title - so an outline whose rows happen to be reported under the outline's own title anyway (a single row, with no <placeholder> in the outline's name) is correctly left alone, its record still being advanced exactly as before.

Scope: like every other use of ScenarioFingerprint, the caller passes one project's scenarios and that project's own persisted history at a time.

  • Constructor Details

    • ReinterpretedOutlines

      public ReinterpretedOutlines()
      Creates a new ReinterpretedOutlines.
  • Method Details

    • find

      Finds every outline this run has re-interpreted, in the order each was first encountered.
      Parameters:
      previous - the history as loaded from disk, keyed by fingerprint, before this run's own scenarios are applied to it
      scenarios - this run's scenarios, outlines already expanded
      Returns:
      one ReinterpretedOutlines.Outline per re-interpreted outline; empty when this run re-interprets none, which is every run but the first after the behaviour was introduced