Interface Test

All Superinterfaces:
Groupable
All Known Subinterfaces:
DynamicTest
All Known Implementing Classes:
AbstractTest, AbstractTest.Dynamic, MethodBasedEventTest, MethodBasedGameTestTest, MethodBasedTest

@ParametersAreNonnullByDefault public interface Test extends Groupable
The base interface for tests in the TestFramework.
  • Method Details

    • id

      String id()
      Returns the ID of this test.
      Returns:
      the ID of this test
    • groups

      List<String> groups()
      A list of the groups of this test.
      If this list is empty, the test will be only in the ungrouped group.
      Returns:
      the groups of this test
    • enabledByDefault

      boolean enabledByDefault()
      Returns if this test is enabled by default.
      Returns:
      if this test is enabled by default
    • onEnabled

      void onEnabled(Test.EventListenerGroup buses)
      This method is called when this test is enabled.
      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
    • onDisabled

      void onDisabled()
      This method is called when this test is disabled.
    • init

      void init(TestFramework framework)
      This method is called when the test is registered to a TestFramework.
      Parameters:
      framework - the framework the test has been registered to
    • visuals

      Test.Visuals visuals()
      Returns the visual information about the test.
      Returns:
      the visual information about the test
    • resolveAsStream

      default Stream<Test> resolveAsStream()
      Resolves all tests in this groupable element as a Stream.
      Specified by:
      resolveAsStream in interface Groupable
      Returns:
      all tests as a stream
    • resolveAll

      default List<Test> resolveAll()
      Resolves all tests in this groupable element.
      Specified by:
      resolveAll in interface Groupable
      Returns:
      all tests
    • asGameTest

      @Nullable default @Nullable GameTestData asGameTest()
      Returns the game test version of this test.
      Returns:
      the game test version of this test
    • listeners

      default Collection<TestListener> listeners()
      Returns the listeners of this test.
      Returns:
      the listeners of this test