From d3b697218773eaa5a3dd368705184726dbc0fa38 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Jun 2025 15:54:07 +0300 Subject: Implement headless testing framework for DS-Sim protocol simulations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Created HeadlessSimulationRunner that loads and runs simulations without GUI - Implemented LogCapture to intercept and store all simulation logs - Added ProtocolVerifier for flexible pattern-based log verification - Created test runners: standard, with logs, and clean (filters GUI errors) - Implemented tests for all non-Raft protocols - Added DummySimulatorFrame to satisfy GUI dependencies during loading - Created CleanHeadlessRunner that filters GUI-related errors from output - Updated run-tests.sh script with quiet mode option - Documented the framework architecture and usage The framework successfully runs protocol tests and verifies behavior through log analysis. GUI errors occur internally due to tight coupling in DS-Sim but are filtered in quiet mode for clean output. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/main/java/testing/VerificationRule.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/main/java/testing/VerificationRule.java (limited to 'src/main/java/testing/VerificationRule.java') diff --git a/src/main/java/testing/VerificationRule.java b/src/main/java/testing/VerificationRule.java new file mode 100644 index 0000000..43d3933 --- /dev/null +++ b/src/main/java/testing/VerificationRule.java @@ -0,0 +1,26 @@ +package testing; + +import java.util.List; + +/** + * Interface for defining verification rules that can be applied + * to simulation logs to verify protocol behavior. + */ +public interface VerificationRule { + /** + * Verify the rule against the provided logs. + * + * @param logs The complete list of log entries from the simulation + * @return Result indicating whether the rule passed and details + */ + RuleResult verify(List logs); + + /** + * Get a human-readable description of what this rule verifies. + * + * @return Description of the rule + */ + default String getDescription() { + return this.getClass().getSimpleName(); + } +} \ No newline at end of file -- cgit v1.2.3