Enum Class TestErrorCode

java.lang.Object
java.lang.Enum<TestErrorCode>
cloud.opencode.base.test.exception.TestErrorCode
All Implemented Interfaces:
Serializable, Comparable<TestErrorCode>, Constable

public enum TestErrorCode extends Enum<TestErrorCode>
Test Error Code 测试错误码

Error codes for test operations (TEST-1xxx ~ 4xxx).

测试操作的错误码(TEST-1xxx ~ 4xxx)。

Features | 主要功能:

  • Categorized test error codes - 分类测试错误码
  • Assertion, setup, execution error codes - 断言、设置、执行错误码

Usage Examples | 使用示例:

TestErrorCode code = TestErrorCode.ASSERTION_FAILED;
System.out.println(code.code() + ": " + code.message());

Security | 安全性:

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

    • ASSERTION_FAILED

      public static final TestErrorCode ASSERTION_FAILED
    • EXPECTED_EXCEPTION_NOT_THROWN

      public static final TestErrorCode EXPECTED_EXCEPTION_NOT_THROWN
    • UNEXPECTED_EXCEPTION

      public static final TestErrorCode UNEXPECTED_EXCEPTION
    • VALUE_MISMATCH

      public static final TestErrorCode VALUE_MISMATCH
    • ASSERTION_NULL

      public static final TestErrorCode ASSERTION_NULL
    • ASSERTION_EQUALS

      public static final TestErrorCode ASSERTION_EQUALS
    • ASSERTION_TIMEOUT

      public static final TestErrorCode ASSERTION_TIMEOUT
    • FIXTURE_NOT_FOUND

      public static final TestErrorCode FIXTURE_NOT_FOUND
    • FIXTURE_INIT_FAILED

      public static final TestErrorCode FIXTURE_INIT_FAILED
    • MOCK_SETUP_FAILED

      public static final TestErrorCode MOCK_SETUP_FAILED
    • MOCK_CREATION_FAILED

      public static final TestErrorCode MOCK_CREATION_FAILED
    • MOCK_NOT_INTERFACE

      public static final TestErrorCode MOCK_NOT_INTERFACE
    • MOCK_VERIFICATION_FAILED

      public static final TestErrorCode MOCK_VERIFICATION_FAILED
    • TIMEOUT

      public static final TestErrorCode TIMEOUT
    • CONCURRENT_ERROR

      public static final TestErrorCode CONCURRENT_ERROR
    • BENCHMARK_FAILED

      public static final TestErrorCode BENCHMARK_FAILED
    • BENCHMARK_TIMEOUT

      public static final TestErrorCode BENCHMARK_TIMEOUT
    • DATA_GENERATION_FAILED

      public static final TestErrorCode DATA_GENERATION_FAILED
    • DATA_RANGE_INVALID

      public static final TestErrorCode DATA_RANGE_INVALID
    • GENERAL_ERROR

      public static final TestErrorCode GENERAL_ERROR
    • INVALID_CONFIGURATION

      public static final TestErrorCode INVALID_CONFIGURATION
  • Method Details

    • values

      public static TestErrorCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TestErrorCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public String code()
      Get error code 获取错误码
      Returns:
      the code | 错误码
    • message

      public String message()
      Get error message 获取错误消息
      Returns:
      the message | 错误消息
    • toString

      public String toString()
      Overrides:
      toString in class Enum<TestErrorCode>