接口 TestFramework.Tests
- 所有已知子接口:
MutableTestFramework.MutableTests
- 所有已知实现类:
TestFrameworkImpl.TestsImpl
- 封闭接口:
TestFramework
@ParametersAreNonnullByDefault
public static interface TestFramework.Tests
Interface used for accessing a framework's tests.
-
方法概要
修饰符和类型方法说明void
addListener
(TestListener listener) Adds a global test listener.@UnmodifiableView Collection
<Test> all()
返回 an unmodifiable view of all the tests registered this this instance。返回 all the registered test groups。Queries a test by its ID.void
Disables a test.void
Enables a test.Gets or creates a test group.boolean
Checks if a test is enabled.void
Registers a test to the framework.
-
方法详细资料
-
byId
Queries a test by its ID.- 参数:
id
- the ID of the test to query- 返回:
- the test, if present
-
getOrCreateGroup
Gets or creates a test group.- 参数:
id
- the ID of the group- 返回:
- the old group, if one existed, or the new one if a group with that ID did not exist before.
-
allGroups
Collection<Group> allGroups()返回 all the registered test groups。- 返回:
- all the registered test groups
-
enable
Enables a test.
This method only updates the local test.
It will not update clients or the server.
Prefer usingTestFramework.setEnabled(Test, boolean, Entity)
instead.- 参数:
id
- the ID of the test to enable
-
disable
Disables a test.
This method only updates the local test.
It will not update clients or the server.
Prefer usingTestFramework.setEnabled(Test, boolean, Entity)
instead.- 参数:
id
- the ID of the test to disable
-
isEnabled
Checks if a test is enabled.- 参数:
id
- the ID of the test to check- 返回:
- if the test is enabled
-
getStatus
-
register
Registers a test to the framework.
It is recommended you register tests during mod loading, for proper indexing.- 参数:
test
- the test to register
-
all
@UnmodifiableView Collection<Test> all()返回 an unmodifiable view of all the tests registered this this instance。- 返回:
- an unmodifiable view of all the tests registered this this instance
-
addListener
Adds a global test listener.- 参数:
listener
- the listener
-