Class TestEventRecorder
java.lang.Object
com.gtnewhorizons.horizonqa.internal.TestEventRecorder
- All Implemented Interfaces:
EventLog
Per-test ordered log of
TestEvents. One instance lives on every GameTestInstance.
Recording is globally toggled by the horizonqa.events system property: passing
-Dhorizonqa.events=off makes record(java.util.function.Supplier<? extends com.gtnewhorizons.horizonqa.api.event.TestEvent>) an unconditional no-op that does not even invoke
the supplier — no record allocation, no payload computation.
Single-thread by construction: a test instance ticks on the server thread, and time-warp re-entry happens on the same thread. No synchronization.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TestEventRecorder
public TestEventRecorder()
-
-
Method Details
-
record
Emit an event. The supplier is only invoked when recording is enabled and the per-test cap is not yet reached, so callers can build complex payloads inside a lambda without paying the cost when the recorder is disabled. -
snapshot
Unmodifiable view of the recorded events in emit order. -
clock
-
isEnabled
public static boolean isEnabled()
-