Uses of Class
cloud.opencode.base.test.TestContext
Packages that use TestContext
-
Uses of TestContext in cloud.opencode.base.test
Fields in cloud.opencode.base.test with type parameters of type TestContextModifier and TypeFieldDescriptionstatic final ScopedValue<TestContext> TestContext.CURRENTCurrent test context (ScopedValue) 当前测试上下文 (ScopedValue)Methods in cloud.opencode.base.test that return TestContextModifier and TypeMethodDescriptionstatic TestContextTestContext.create()Creates a new test context with default name 使用默认名称创建新的测试上下文static TestContextCreates a new test context with test name 使用测试名称创建新的测试上下文static TestContextTestContext.currentOrCreate()Gets the current context or creates a new one 获取当前上下文或创建新的static TestContextTestContext.currentOrCreate(String testName) Gets the current context or creates one with specified name 获取当前上下文或使用指定名称创建新的TestContext.onFailure(TestContext.FailureCallback callback) Registers a failure callback 注册失败回调TestContext.onSuccess(Consumer<TestContext> callback) Registers a success callback 注册成功回调TestContext.removeVariable(String key) Removes a variable from the context 从上下文中移除变量TestContext.setAttribute(String key, Object value) Sets an attribute (metadata) in the context 在上下文中设置属性(元数据)TestContext.setVariable(String key, Object value) Sets a variable in the context 在上下文中设置变量Methods in cloud.opencode.base.test that return types with arguments of type TestContextModifier and TypeMethodDescriptionstatic Optional<TestContext> TestContext.current()Gets the current test context 获取当前测试上下文Methods in cloud.opencode.base.test with parameters of type TestContextModifier and TypeMethodDescriptionvoidTestContext.FailureCallback.onFailure(TestContext context, Throwable throwable) Called when test fails 测试失败时调用static voidTestContext.run(TestContext context, Runnable task) Runs a runnable within this context 在此上下文中运行可运行对象static <T, X extends Throwable>
TTestContext.run(TestContext context, ScopedValue.CallableOp<T, X> task) Runs a callable within this context 在此上下文中运行可调用对象Method parameters in cloud.opencode.base.test with type arguments of type TestContextModifier and TypeMethodDescriptionTestContext.onSuccess(Consumer<TestContext> callback) Registers a success callback 注册成功回调