Annotation Interface Repeat


@Target(METHOD) @Retention(RUNTIME) public @interface Repeat
Repeat 重复

Marks a test to be repeated multiple times.

标记测试重复多次执行。

Features | 主要功能:

  • Repeat test execution annotation - 重复测试执行注解
  • Configurable iteration count - 可配置的迭代次数

Usage Examples | 使用示例:

@Repeat(100)
void shouldBeConsistent() {
    // Repeated test
}

Security | 安全性:

  • Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
Since:
JDK 25, opencode-base-test V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Fail fast on first failure 首次失败时快速失败
    int
    Number of times to repeat 重复次数
  • Element Details

    • value

      int value
      Number of times to repeat 重复次数
      Returns:
      the count | 次数
      Default:
      1
    • failFast

      boolean failFast
      Fail fast on first failure 首次失败时快速失败
      Returns:
      true to fail fast | 如果快速失败返回true
      Default:
      true