Class AbstractTest.Dynamic
java.lang.Object
net.neoforged.testframework.impl.test.AbstractTest
net.neoforged.testframework.impl.test.AbstractTest.Dynamic
- All Implemented Interfaces:
- DynamicTest,- Groupable,- Test
- Direct Known Subclasses:
- MethodBasedEventTest,- MethodBasedGameTestTest,- MethodBasedTest
- Enclosing class:
- AbstractTest
@ParametersAreNonnullByDefault
public abstract static class AbstractTest.Dynamic
extends AbstractTest
implements DynamicTest
- 
Nested Class SummaryNested classes/interfaces inherited from class net.neoforged.testframework.impl.test.AbstractTestAbstractTest.AnnotationHolder, AbstractTest.DynamicNested classes/interfaces inherited from interface net.neoforged.testframework.DynamicTestDynamicTest.EnabledListenerNested classes/interfaces inherited from interface net.neoforged.testframework.TestTest.EventListenerGroup, Test.Result, Test.Status, Test.Visuals
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final List<DynamicTest.EnabledListener>private final Supplier<Test.EventListenerGroup>private booleanprivate final List<Consumer<ExtendedGameTestHelper>>Fields inherited from class net.neoforged.testframework.impl.test.AbstractTestenabledByDefault, framework, gameTestData, groups, id, listeners, visuals
- 
Constructor SummaryConstructors
- 
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.voidMarks this test as failed.Returns the framework this test is linked to.protected StringgameTestTemplate(GameTest gameTest) booleanReturns if this test is currently running as a GameTest.voidThis method is called when this test is disabled.voidonEnabled(Test.EventListenerGroup buses) This method is called when this test is enabled.voidonGameTest(Consumer<ExtendedGameTestHelper> consumer) Registers a listener to run when the GameTest version of this test is run.protected voidonGameTest(GameTestHelper helper) voidpass()Marks this test as passed.Returns a new registration helper with a computed mod ID.registrationHelper(String modId) Returns a new registration helper with the givenmodId.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 class net.neoforged.testframework.impl.test.AbstractTestasGameTest, configureFrom, configureGameTest, enable, enabledByDefault, groups, id, init, isEnabled, listeners, logger, requestConfirmation, status, updateStatus, visualsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.testframework.DynamicTestregisterGameTestTemplate, registerGameTestTemplate, requestConfirmation, status, updateStatusMethods inherited from interface net.neoforged.testframework.TestasGameTest, enabledByDefault, groups, id, init, listeners, resolveAll, resolveAsStream, visuals
- 
Field Details- 
enabledListeners
- 
eventListeners
- 
disabledListeners
- 
onGameTest
- 
isDuringGameTestprivate boolean isDuringGameTest
 
- 
- 
Constructor Details- 
Dynamicpublic Dynamic()
 
- 
- 
Method Details- 
frameworkDescription copied from interface:DynamicTestReturns the framework this test is linked to.- Specified by:
- frameworkin interface- DynamicTest
- Returns:
- the framework this test is linked to
 
- 
whenEnabledDescription copied from interface:DynamicTestRegisters a listener to run when this test is enabled.- Specified by:
- whenEnabledin interface- DynamicTest
- Parameters:
- whenEnabled- the listener
 
- 
eventListenersDescription copied from interface:DynamicTestReturns a listener group used to subscribe to events when the test is enabled.- Specified by:
- eventListenersin interface- DynamicTest
- Returns:
- a listener group used to subscribe to events when the test is enabled
- See Also:
 
- 
whenDisabledDescription copied from interface:DynamicTestRegisters a listener to run when this test is disabled.- Specified by:
- whenDisabledin interface- DynamicTest
- Parameters:
- whenDisabled- the listener
 
- 
onEnabledDescription copied from interface:TestThis method is called when this test is enabled.- Specified by:
- onEnabledin interface- Test
- Overrides:
- onEnabledin class- AbstractTest
- Parameters:
- buses- a collector for event listeners. Prefer using this listener instead of the casual- IEventBus.addListener(Consumer)or- IEventBus.register(Object), as the collector will automatically unregister listeners when the test is disabled
 
- 
onDisabledpublic void onDisabled()Description copied from interface:TestThis method is called when this test is disabled.- Specified by:
- onDisabledin interface- Test
- Overrides:
- onDisabledin class- AbstractTest
 
- 
onGameTestDescription copied from interface:DynamicTestRegisters a listener to run when the GameTest version of this test is run.- Specified by:
- onGameTestin interface- DynamicTest
- Parameters:
- consumer- the listener
 
- 
registrationHelperDescription copied from interface:DynamicTestReturns a new registration helper with the givenmodId.- Specified by:
- registrationHelperin interface- DynamicTest
- Returns:
- a new registration helper with the given modId
 
- 
registrationHelperDescription copied from interface:DynamicTestReturns a new registration helper with a computed mod ID.- Specified by:
- registrationHelperin interface- DynamicTest
- Returns:
- a new registration helper with a computed mod ID
 
- 
createModIdDescription copied from interface:DynamicTestReturns a computed mod id based on this test's ID.- Specified by:
- createModIdin interface- DynamicTest
- Returns:
- a computed mod id based on this test's ID
 
- 
gameTestTemplate- Overrides:
- gameTestTemplatein class- AbstractTest
 
- 
onGameTest- Overrides:
- onGameTestin class- AbstractTest
 
- 
isDuringGameTestpublic boolean isDuringGameTest()Description copied from interface:DynamicTestReturns if this test is currently running as a GameTest.- Specified by:
- isDuringGameTestin interface- DynamicTest
- Returns:
- if this test is currently running as a GameTest
 
- 
failDescription copied from interface:DynamicTestMarks this test as failed.- Specified by:
- failin interface- DynamicTest
- Overrides:
- failin class- AbstractTest
- Parameters:
- message- additional information explaining why the test failed
 
- 
passpublic void pass()Description copied from interface:DynamicTestMarks this test as passed.- Specified by:
- passin interface- DynamicTest
- Overrides:
- passin class- AbstractTest
 
 
-