Documentation Index
Fetch the complete documentation index at: https://docs.hrtk.frotty27.com/llms.txt
Use this file to discover all available pages before exploring further.
HRTK provides 26 annotations across the com.frotty27.hrtk.api.annotation package. This page is a quick-reference table with brief descriptions and links to the relevant documentation.
Test Markers
These annotations mark methods as tests or benchmarks. At least one must be present for HRTK to discover the method. All test marker annotations listed below are fully recognized by the discovery engine - any method annotated with one of these will be discovered and executed.
| Annotation | Target | Description | Docs |
|---|
@HytaleTest | Method | Primary test marker. Optional display name parameter. | Your First Test |
@EcsTest | Method | ECS-level test. Injects EcsTestContext, adds "ecs" tag. | ECS Testing |
@WorldTest | Method | World-level test. Injects WorldTestContext, adds "integration" tag. | World Testing |
@CombatTest | Method | Combat test. Provides WorldTestContext for combat scenarios. | Stats & Combat |
@StatsTest | Method | Stats-focused test. Marker for stat-related testing. | Stats & Combat |
@InventoryTest | Method | Inventory test. Marker for inventory-related testing. | Inventory & Loot |
@SpawnTest | Method | Spawn test. Marker for entity spawning scenarios. | World Testing |
@FlowTest | Method | Multi-step flow test. world and timeoutTicks parameters. | Flow Tests |
@AsyncTest | Method | Async test with timeoutTicks for tick-based timeout. Fully recognized as a test marker by the discovery engine. | Async & Tick Waiting |
@Benchmark | Method | Performance benchmark. warmup, iterations, batchSize. | Benchmarks |
@RepeatedTest | Method | Run N times. Each repetition reported separately. | Timeouts & Repetition |
@ParameterizedTest | Method | Run with multiple values from @ValueSource. | Parameterized Tests |
Configuration
These annotations configure how tests behave.
| Annotation | Target | Description | Docs |
|---|
@HytaleSuite | Class | Suite marker. value (name), isolation (strategy). | Test Suites |
@Tag | Class/Method | String tag(s) for filtering. Multiple values supported. | Filtering & Tags |
@Order | Method | Execution order within suite. Lower values run first. | Filtering & Tags |
@DisplayName | Method | Override the display name in results. | Filtering & Tags |
@Disabled | Class/Method | Skip the test/suite. Optional reason string. | Filtering & Tags |
@Timeout | Method | Maximum duration. value + unit (default seconds). | Timeouts & Repetition |
@ValueSource | Method | Parameter values for @ParameterizedTest. ints, strings, doubles, etc. | Parameterized Tests |
Requirements
These annotations declare preconditions for test execution.
| Annotation | Target | Description | Docs |
|---|
@RequiresWorld | Method | Test needs a world. Optional value for world name. | World Testing |
@RequiresPlayer | Method | Test needs player-like context. Optional count. | Command Testing |
@RequiresPlugin | Method | Test needs a specific plugin loaded. Skipped if absent. | How It Works |
Lifecycle
These annotations mark setup and teardown methods.
| Annotation | Target | Description | Docs |
|---|
@BeforeAll | Method | Run once before the first test. Can be static. | Lifecycle Hooks |
@AfterAll | Method | Run once after the last test. Can be static. | Lifecycle Hooks |
@BeforeEach | Method | Run before every test method. Instance method. | Lifecycle Hooks |
@AfterEach | Method | Run after every test method. Instance method. | Lifecycle Hooks |
Usage Pattern
A typical test class uses a combination of these annotations:
@HytaleSuite(value = "My Tests", isolation = IsolationStrategy.SNAPSHOT)
@Tag("ecs")
public class MyTests {
@BeforeAll
static void setup() { }
@BeforeEach
void resetState() { }
@HytaleTest
@Order(1)
@DisplayName("Component attaches correctly")
void testComponentAttach(EcsTestContext ctx) { }
@EcsTest
@Order(2)
@Timeout(value = 500, unit = TimeUnit.MILLISECONDS)
void testFastQuery(EcsTestContext ctx) { }
@ParameterizedTest
@ValueSource(ints = {1, 2, 3})
void testTiers(int tier) { }
@HytaleTest
@Disabled("Not yet implemented")
void testFutureFeature() { }
@AfterEach
void cleanup() { }
@AfterAll
static void teardown() { }
}
Next Steps