Class TestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.test.exception.TestException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AssertionException, BenchmarkException, DataGenerationException, MockException
Test Exception
测试异常
Exception thrown during test execution.
测试执行期间抛出的异常。
Features | 主要功能:
- Test execution exception handling - 测试执行异常处理
- Error code support - 错误码支持
Usage Examples | 使用示例:
throw new TestException(TestErrorCode.ASSERTION_FAILED, "Values differ");
Security | 安全性:
- Thread-safe: No - 线程安全: 否
- Since:
- JDK 25, opencode-base-test V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTestException(TestErrorCode errorCode) Create test exception 创建测试异常TestException(TestErrorCode errorCode, String detail) Create test exception with detail 创建带详情的测试异常TestException(TestErrorCode errorCode, Throwable cause) Create test exception with cause 创建带原因的测试异常TestException(String message) Create test exception with message 创建带消息的测试异常TestException(String message, Throwable cause) Create test exception with message and cause 创建带消息和原因的测试异常 -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TestException
Create test exception 创建测试异常- Parameters:
errorCode- the error code | 错误码
-
TestException
Create test exception with detail 创建带详情的测试异常- Parameters:
errorCode- the error code | 错误码detail- the detail message | 详细消息
-
TestException
Create test exception with cause 创建带原因的测试异常- Parameters:
errorCode- the error code | 错误码cause- the cause | 原因
-
TestException
Create test exception with message 创建带消息的测试异常- Parameters:
message- the message | 消息
-
TestException
-
-
Method Details
-
getErrorCode
-