Class CheckpointCounter

java.lang.Object
com.shaft.tools.io.internal.CheckpointCounter

public class CheckpointCounter extends Object
Aggregates validation checkpoints and attaches a summarized HTML report to Allure.

Each call to increment(CheckpointType, String, CheckpointStatus) stores one checkpoint entry and updates pass/fail counters. Call attach() once at the end of execution to publish the generated report attachment.

  • Constructor Details

    • CheckpointCounter

      public CheckpointCounter()
      Creates a new checkpoint counter instance.
  • Method Details

    • increment

      public static void increment(CheckpointType type, String message, CheckpointStatus status)
      Creates a new checkpoint entry and updates the pass/fail counters. The entry is stamped with a stable, process-wide id and the current test's identity (class/method), so it can be attributed and deep-linked to its owning test even though the checkpoint list is cumulative.
      Parameters:
      type - the checkpoint type (assertion or verification)
      message - the checkpoint message
      status - the final status of the checkpoint
    • resetForTesting

      public static void resetForTesting()
      Testing-support hook only — not for production use. Resets the process-wide, static checkpoint accumulation back to its initial empty/zero state: it clears the checkpoints list, zeroes the passedCheckpoints/failedCheckpoints counters, and resets the monotonic checkpointSequence id source so the next captured checkpoint restarts at id 1.

      Because this static state is shared by every test in the same forked JVM (any SHAFT Validation/Verification records a checkpoint via ValidationsHelper), tests that must isolate themselves from checkpoints left behind by earlier-run tests call this between methods. It exists as a single, public entry point so those tests no longer each reflect into these private fields to clear them (issue #3846); it is public rather than package-private because consumer tests live outside this package.

    • attach

      public static void attach()
      Attaches the accumulated checkpoint summary HTML report to the current report context.

      If no checkpoints were recorded, this method does nothing.