类 AbstractTest.Dynamic
java.lang.Object
net.neoforged.testframework.impl.test.AbstractTest
net.neoforged.testframework.impl.test.AbstractTest.Dynamic
- 所有已实现的接口:
DynamicTest
,Groupable
,Test
- 封闭类:
AbstractTest
@ParametersAreNonnullByDefault
public abstract static class AbstractTest.Dynamic
extends AbstractTest
implements DynamicTest
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.testframework.impl.test.AbstractTest
AbstractTest.AnnotationHolder, AbstractTest.Dynamic
从接口继承的嵌套类/接口 net.neoforged.testframework.DynamicTest
DynamicTest.EnabledListener
从接口继承的嵌套类/接口 net.neoforged.testframework.Test
Test.EventListenerGroup, Test.Result, Test.Status, Test.Visuals
-
字段概要
字段修饰符和类型字段说明private final List
<DynamicTest.EnabledListener> private final Supplier
<Test.EventListenerGroup> private boolean
private final List
<Consumer<GameTestHelper>> 从类继承的字段 net.neoforged.testframework.impl.test.AbstractTest
enabledByDefault, framework, gameTestData, groups, id, listeners, visuals
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 a computed mod id based on this test's ID。返回 a listener group used to subscribe to events when the test is enabled。void
Marks this test as failed.返回 the framework this test is linked to。protected String
gameTestTemplate
(GameTest gameTest) boolean
返回 if this test is currently running as a GameTest。void
This method is called when this test is disabled.void
onEnabled
(Test.EventListenerGroup buses) This method is called when this test is enabled.<T extends GameTestHelper>
voidonGameTest
(Class<T> helperType, Consumer<T> consumer) Registers a listener to run when the GameTest version of this test is run.void
onGameTest
(Consumer<ExtendedGameTestHelper> consumer) Registers a listener to run when the GameTest version of this test is run.protected void
onGameTest
(GameTestHelper helper) private <T extends GameTestHelper>
voidonGameTest
(GameTestHelperFactory<T> factory, Consumer<T> consumer) void
pass()
Marks this test as passed.返回 a new registration helper with a computed mod ID。registrationHelper
(String modId) 返回 a new registration helper with the givenmodId
。void
whenDisabled
(Runnable whenDisabled) Registers a listener to run when this test is disabled.void
whenEnabled
(DynamicTest.EnabledListener whenEnabled) Registers a listener to run when this test is enabled.从类继承的方法 net.neoforged.testframework.impl.test.AbstractTest
asGameTest, configureFrom, configureGameTest, enable, enabledByDefault, groups, id, init, isEnabled, listeners, logger, requestConfirmation, status, updateStatus, visuals
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.testframework.DynamicTest
registerGameTestTemplate, registerGameTestTemplate, requestConfirmation, status, updateStatus
从接口继承的方法 net.neoforged.testframework.Test
asGameTest, enabledByDefault, groups, id, init, listeners, resolveAll, resolveAsStream, visuals
-
字段详细资料
-
enabledListeners
-
eventListeners
-
disabledListeners
-
onGameTest
-
isDuringGameTest
private boolean isDuringGameTest
-
-
构造器详细资料
-
Dynamic
public Dynamic()
-
-
方法详细资料
-
framework
从接口复制的说明:DynamicTest
返回 the framework this test is linked to。- 指定者:
framework
在接口中DynamicTest
- 返回:
- the framework this test is linked to
-
whenEnabled
从接口复制的说明:DynamicTest
Registers a listener to run when this test is enabled.- 指定者:
whenEnabled
在接口中DynamicTest
- 参数:
whenEnabled
- the listener
-
eventListeners
从接口复制的说明:DynamicTest
返回 a listener group used to subscribe to events when the test is enabled。- 指定者:
eventListeners
在接口中DynamicTest
- 返回:
- a listener group used to subscribe to events when the test is enabled
- 另请参阅:
-
whenDisabled
从接口复制的说明:DynamicTest
Registers a listener to run when this test is disabled.- 指定者:
whenDisabled
在接口中DynamicTest
- 参数:
whenDisabled
- the listener
-
onEnabled
从接口复制的说明:Test
This method is called when this test is enabled.- 指定者:
onEnabled
在接口中Test
- 覆盖:
onEnabled
在类中AbstractTest
- 参数:
buses
- a collector for event listeners. Prefer using this listener instead of the casualIEventBus.addListener(Consumer)
orIEventBus.register(Object)
, as the collector will automatically unregister listeners when the test is disabled
-
onDisabled
public void onDisabled()从接口复制的说明:Test
This method is called when this test is disabled.- 指定者:
onDisabled
在接口中Test
- 覆盖:
onDisabled
在类中AbstractTest
-
onGameTest
从接口复制的说明:DynamicTest
Registers a listener to run when the GameTest version of this test is run.- 指定者:
onGameTest
在接口中DynamicTest
- 参数:
consumer
- the listener
-
onGameTest
从接口复制的说明:DynamicTest
Registers a listener to run when the GameTest version of this test is run.- 指定者:
onGameTest
在接口中DynamicTest
- 参数:
helperType
- the type to use for the helperconsumer
- the listener
-
onGameTest
private <T extends GameTestHelper> void onGameTest(GameTestHelperFactory<T> factory, Consumer<T> consumer) -
registrationHelper
从接口复制的说明:DynamicTest
返回 a new registration helper with the givenmodId
。- 指定者:
registrationHelper
在接口中DynamicTest
- 返回:
- a new registration helper with the given
modId
-
registrationHelper
从接口复制的说明:DynamicTest
返回 a new registration helper with a computed mod ID。- 指定者:
registrationHelper
在接口中DynamicTest
- 返回:
- a new registration helper with a computed mod ID
-
createModId
从接口复制的说明:DynamicTest
返回 a computed mod id based on this test's ID。- 指定者:
createModId
在接口中DynamicTest
- 返回:
- a computed mod id based on this test's ID
-
gameTestTemplate
- 覆盖:
gameTestTemplate
在类中AbstractTest
-
onGameTest
- 覆盖:
onGameTest
在类中AbstractTest
-
isDuringGameTest
public boolean isDuringGameTest()从接口复制的说明:DynamicTest
返回 if this test is currently running as a GameTest。- 指定者:
isDuringGameTest
在接口中DynamicTest
- 返回:
- if this test is currently running as a GameTest
-
fail
从接口复制的说明:DynamicTest
Marks this test as failed.- 指定者:
fail
在接口中DynamicTest
- 覆盖:
fail
在类中AbstractTest
- 参数:
message
- additional information explaining why the test failed
-
pass
public void pass()从接口复制的说明:DynamicTest
Marks this test as passed.- 指定者:
pass
在接口中DynamicTest
- 覆盖:
pass
在类中AbstractTest
-