Package net.neoforged.testframework.impl
Class TestFrameworkImpl.TestsImpl
java.lang.Object
net.neoforged.testframework.impl.TestFrameworkImpl.TestsImpl
- All Implemented Interfaces:
- MutableTestFramework.MutableTests,- TestFramework.Tests
- Enclosing class:
- TestFrameworkImpl
@ParametersAreNonnullByDefault
public final class TestFrameworkImpl.TestsImpl
extends Object
implements MutableTestFramework.MutableTests
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final Collection<Test>private Map<net.neoforged.fml.common.Mod.EventBusSubscriber.Bus,net.neoforged.bus.api.IEventBus> private final Map<String,EventListenerGroupImpl> private final Set<TestListener>private final Map<String,Test.Status> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate GroupaddGroupToParents(Group group) voidaddListener(TestListener listener) Adds a global test listener.all()Returns an unmodifiable view of all the tests registered this this instance.Returns all the registered test groups.Queries a test by its ID.voidDisables a test.voidEnables a test.enabled()Gets or creates a test group.voidbooleanChecks if a test is enabled.maybeGetGroup(String id) voidRegisters a test to the framework.voidsetStatus(String testId, Test.Status status) 
- 
Field Details- 
tests
- 
groups
- 
collectors
- 
enabled
- 
statuses
- 
busesprivate Map<net.neoforged.fml.common.Mod.EventBusSubscriber.Bus,net.neoforged.bus.api.IEventBus> buses
- 
globalListeners
- 
allView
 
- 
- 
Constructor Details- 
TestsImplpublic TestsImpl()
 
- 
- 
Method Details- 
addListenerDescription copied from interface:TestFramework.TestsAdds a global test listener.- Specified by:
- addListenerin interface- TestFramework.Tests
- Parameters:
- listener- the listener
 
- 
byIdDescription copied from interface:TestFramework.TestsQueries a test by its ID.- Specified by:
- byIdin interface- TestFramework.Tests
- Parameters:
- id- the ID of the test to query
- Returns:
- the test, if present
 
- 
getOrCreateGroupDescription copied from interface:TestFramework.TestsGets or creates a test group.- Specified by:
- getOrCreateGroupin interface- TestFramework.Tests
- Parameters:
- id- the ID of the group
- Returns:
- the old group, if one existed, or the new one if a group with that ID did not exist before.
 
- 
maybeGetGroup- Specified by:
- maybeGetGroupin interface- MutableTestFramework.MutableTests
 
- 
allGroupsDescription copied from interface:TestFramework.TestsReturns all the registered test groups.- Specified by:
- allGroupsin interface- TestFramework.Tests
- Returns:
- all the registered test groups
 
- 
enableDescription copied from interface:TestFramework.TestsEnables a test.
 
 This method only updates the local test.
 It will not update clients or the server.
 Prefer usingTestFramework.setEnabled(Test, boolean, Entity)instead.- Specified by:
- enablein interface- TestFramework.Tests
- Parameters:
- id- the ID of the test to enable
 
- 
disableDescription copied from interface:TestFramework.TestsDisables a test.
 
 This method only updates the local test.
 It will not update clients or the server.
 Prefer usingTestFramework.setEnabled(Test, boolean, Entity)instead.- Specified by:
- disablein interface- TestFramework.Tests
- Parameters:
- id- the ID of the test to disable
 
- 
isEnabledDescription copied from interface:TestFramework.TestsChecks if a test is enabled.- Specified by:
- isEnabledin interface- TestFramework.Tests
- Parameters:
- id- the ID of the test to check
- Returns:
- if the test is enabled
 
- 
getStatus- Specified by:
- getStatusin interface- TestFramework.Tests
 
- 
setStatus- Specified by:
- setStatusin interface- MutableTestFramework.MutableTests
 
- 
registerDescription copied from interface:TestFramework.TestsRegisters a test to the framework.
 It is recommended you register tests during mod loading, for proper indexing.- Specified by:
- registerin interface- TestFramework.Tests
- Parameters:
- test- the test to register
 
- 
addGroupToParents
- 
allDescription copied from interface:TestFramework.TestsReturns an unmodifiable view of all the tests registered this this instance.- Specified by:
- allin interface- TestFramework.Tests
- Returns:
- an unmodifiable view of all the tests registered this this instance
 
- 
enabled- Specified by:
- enabledin interface- MutableTestFramework.MutableTests
 
- 
initialiseDefaultEnabledTestspublic void initialiseDefaultEnabledTests()- Specified by:
- initialiseDefaultEnabledTestsin interface- MutableTestFramework.MutableTests
 
 
-