Class ProgressHistoryStore
java.lang.Object
com.arc_e_tect.gradle.gherkin.progress.ProgressHistoryStore
Reads and writes
ScenarioProgressRecords as newline-delimited JSON (NDJSON), one record
per line, sorted by ScenarioProgressRecord.fingerprint() so that git diffs of the
persisted file are minimal and stable regardless of scenario reordering or scenarios moving
between feature files.
The schema is fixed and flat, so the serializer/parser is hand-rolled (no JSON library
dependency) - only ScenarioProgressRecord.scenarioName() and
ScenarioProgressRecord.featureTitle() are free text and need escaping.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLoads the progress history fromfile.voidsave(File file, Collection<ScenarioProgressRecord> records) Writesrecordstofileas NDJSON, sorted byScenarioProgressRecord.fingerprint(), overwriting any existing content.
-
Constructor Details
-
ProgressHistoryStore
public ProgressHistoryStore()Creates a newProgressHistoryStore.
-
-
Method Details
-
load
Loads the progress history fromfile.- Parameters:
file- the NDJSON history file; need not exist- Returns:
- the records keyed by fingerprint; empty when
filedoesn't exist. A line that fails to parse is skipped with aWARN-level log message identifying the line number - it never fails the build.
-
save
Writesrecordstofileas NDJSON, sorted byScenarioProgressRecord.fingerprint(), overwriting any existing content.- Parameters:
file- the NDJSON history file to writerecords- the records to persist
-