Package net.neoforged.testframework
Interface DynamicTest
- All Known Implementing Classes:
- AbstractTest.Dynamic,- MethodBasedEventTest,- MethodBasedGameTestTest,- MethodBasedTest
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface net.neoforged.testframework.TestTest.EventListenerGroup, Test.Result, Test.Status, Test.Visuals
- 
Method SummaryModifier and TypeMethodDescriptionReturns a computed mod id based on this test's ID.Returns a listener group used to subscribe to events when the test is enabled.default voidMarks this test as failed.Returns the framework this test is linked to.booleanReturns if this test is currently running as a GameTest.<T extends GameTestHelper>
 voidonGameTest(Class<T> helperType, Consumer<T> consumer) Registers a listener to run when the GameTest version of this test is run.default voidonGameTest(Consumer<ExtendedGameTestHelper> consumer) Registers a listener to run when the GameTest version of this test is run.default voidpass()Marks this test as passed.default voidRegister the template for this game test.default voidRegister the template for this game test.Returns a new registration helper with a computed mod ID.registrationHelper(String modId) Returns a new registration helper with the givenmodId.voidrequestConfirmation(Player player, Component message) Requests a confirmation of the test passing from a player.default Test.Statusstatus()Returns the status of this test.default voidupdateStatus(Test.Status newStatus, @Nullable Entity updater) Updates the status of the test.voidwhenDisabled(Runnable whenDisabled) Registers a listener to run when this test is disabled.voidwhenEnabled(DynamicTest.EnabledListener whenEnabled) Registers a listener to run when this test is enabled.Methods inherited from interface net.neoforged.testframework.TestasGameTest, enabledByDefault, groups, id, init, listeners, onDisabled, onEnabled, resolveAll, resolveAsStream, visuals
- 
Method Details- 
frameworkTestFramework framework()Returns the framework this test is linked to.- Returns:
- the framework this test is linked to
 
- 
statusReturns the status of this test.- Returns:
- the status of this test
 
- 
updateStatusUpdates the status of the test.- Parameters:
- newStatus- the new status
- updater- the entity which updated the status
 
- 
passdefault void pass()Marks this test as passed.
- 
failMarks this test as failed.- Parameters:
- message- additional information explaining why the test failed
 
- 
whenEnabledRegisters a listener to run when this test is enabled.- Parameters:
- whenEnabled- the listener
 
- 
eventListenersTest.EventListenerGroup eventListeners()Returns a listener group used to subscribe to events when the test is enabled.- Returns:
- a listener group used to subscribe to events when the test is enabled
- See Also:
 
- 
whenDisabledRegisters a listener to run when this test is disabled.- Parameters:
- whenDisabled- the listener
 
- 
onGameTestRegisters a listener to run when the GameTest version of this test is run.- Parameters:
- consumer- the listener
 
- 
onGameTestRegisters a listener to run when the GameTest version of this test is run.- Parameters:
- helperType- the type to use for the helper
- consumer- the listener
 
- 
registerGameTestTemplateRegister the template for this game test.- Parameters:
- builder- the builder of the template
 
- 
registerGameTestTemplateRegister the template for this game test.- Parameters:
- builder- a supplier of the builder of the template
 
- 
registrationHelperReturns a new registration helper with the givenmodId.- Returns:
- a new registration helper with the given modId
 
- 
registrationHelperRegistrationHelper registrationHelper()Returns a new registration helper with a computed mod ID.- Returns:
- a new registration helper with a computed mod ID
 
- 
createModIdString createModId()Returns a computed mod id based on this test's ID.- Returns:
- a computed mod id based on this test's ID
 
- 
isDuringGameTestboolean isDuringGameTest()Returns if this test is currently running as a GameTest.- Returns:
- if this test is currently running as a GameTest
 
- 
requestConfirmationRequests a confirmation of the test passing from a player.- Parameters:
- player- the player to request the confirmation from
- message- the confirmation message
 
 
-