Interface TestFramework.Tests

All Known Subinterfaces:
MutableTestFramework.MutableTests
All Known Implementing Classes:
TestFrameworkImpl.TestsImpl
Enclosing interface:
TestFramework

@ParametersAreNonnullByDefault public static interface TestFramework.Tests
Interface used for accessing a framework's tests.
  • Method Details

    • byId

      Optional<Test> byId(String id)
      Queries a test by its ID.
      Parameters:
      id - the ID of the test to query
      Returns:
      the test, if present
    • getOrCreateGroup

      Group getOrCreateGroup(String id)
      Gets or creates a test group.
      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.
    • allGroups

      Collection<Group> allGroups()
      Returns all the registered test groups.
      Returns:
      all the registered test groups
    • enable

      void enable(String id)
      Enables a test.

      This method only updates the local test.
      It will not update clients or the server.
      Prefer using TestFramework.setEnabled(Test, boolean, Entity) instead.
      Parameters:
      id - the ID of the test to enable
    • disable

      void disable(String id)
      Disables a test.

      This method only updates the local test.
      It will not update clients or the server.
      Prefer using TestFramework.setEnabled(Test, boolean, Entity) instead.
      Parameters:
      id - the ID of the test to disable
    • isEnabled

      boolean isEnabled(String id)
      Checks if a test is enabled.
      Parameters:
      id - the ID of the test to check
      Returns:
      if the test is enabled
    • getStatus

      Test.Status getStatus(String testId)
    • register

      void register(Test test)
      Registers a test to the framework.
      It is recommended you register tests during mod loading, for proper indexing.
      Parameters:
      test - the test to register
    • all

      @UnmodifiableView Collection<Test> all()
      Returns an unmodifiable view of all the tests registered this this instance.
      Returns:
      an unmodifiable view of all the tests registered this this instance
    • addListener

      void addListener(TestListener listener)
      Adds a global test listener.
      Parameters:
      listener - the listener