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 Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection<Test> private Map<net.neoforged.fml.common.EventBusSubscriber.Bus, net.neoforged.bus.api.IEventBus> private final Map<String, EventListenerGroupImpl> private final Set<TestListener> private final Map<String, Test.Status> -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
buses
-
globalListeners
-
allView
-
-
Constructor Details
-
TestsImpl
public TestsImpl()
-
-
Method Details
-
addListener
Description copied from interface:TestFramework.TestsAdds a global test listener.- Specified by:
addListenerin interfaceTestFramework.Tests- Parameters:
listener- the listener
-
byId
Description copied from interface:TestFramework.TestsQueries a test by its ID.- Specified by:
byIdin interfaceTestFramework.Tests- Parameters:
id- the ID of the test to query- Returns:
- the test, if present
-
getOrCreateGroup
Description copied from interface:TestFramework.TestsGets or creates a test group.- Specified by:
getOrCreateGroupin interfaceTestFramework.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 interfaceMutableTestFramework.MutableTests
-
allGroups
Description copied from interface:TestFramework.TestsReturns all the registered test groups.- Specified by:
allGroupsin interfaceTestFramework.Tests- Returns:
- all the registered test groups
-
enable
Description 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 interfaceTestFramework.Tests- Parameters:
id- the ID of the test to enable
-
disable
Description 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 interfaceTestFramework.Tests- Parameters:
id- the ID of the test to disable
-
isEnabled
Description copied from interface:TestFramework.TestsChecks if a test is enabled.- Specified by:
isEnabledin interfaceTestFramework.Tests- Parameters:
id- the ID of the test to check- Returns:
- if the test is enabled
-
getStatus
- Specified by:
getStatusin interfaceTestFramework.Tests
-
setStatus
- Specified by:
setStatusin interfaceMutableTestFramework.MutableTests
-
register
Description 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 interfaceTestFramework.Tests- Parameters:
test- the test to register
-
addGroupToParents
-
all
Description copied from interface:TestFramework.TestsReturns an unmodifiable view of all the tests registered this this instance.- Specified by:
allin interfaceTestFramework.Tests- Returns:
- an unmodifiable view of all the tests registered this this instance
-
enabled
- Specified by:
enabledin interfaceMutableTestFramework.MutableTests
-
initialiseDefaultEnabledTests
public void initialiseDefaultEnabledTests()- Specified by:
initialiseDefaultEnabledTestsin interfaceMutableTestFramework.MutableTests
-