Class AbstractTest

java.lang.Object
net.neoforged.testframework.impl.test.AbstractTest
All Implemented Interfaces:
Groupable, Test
Direct Known Subclasses:
AbstractTest.Dynamic

@ParametersAreNonnullByDefault public abstract class AbstractTest extends Object implements Test
  • Field Details

  • Constructor Details

    • AbstractTest

      protected AbstractTest()
  • Method Details

    • configureFrom

      protected final void configureFrom(AbstractTest.AnnotationHolder holder)
    • configureGameTest

      protected final void configureGameTest(@Nullable @Nullable GameTest gameTest, @Nullable @Nullable EmptyTemplate template)
    • gameTestTemplate

      protected String gameTestTemplate(GameTest gameTest)
    • init

      public void init(TestFramework framework)
      Description copied from interface: Test
      This method is called when the test is registered to a TestFramework.
      Specified by:
      init in interface Test
      Parameters:
      framework - the framework the test has been registered to
    • onDisabled

      public void onDisabled()
      Description copied from interface: Test
      This method is called when this test is disabled.
      Specified by:
      onDisabled in interface Test
    • onEnabled

      public void onEnabled(Test.EventListenerGroup buses)
      Description copied from interface: Test
      This method is called when this test is enabled.
      Specified by:
      onEnabled in interface Test
      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
    • onGameTest

      protected void onGameTest(GameTestHelper helper)
    • id

      public String id()
      Description copied from interface: Test
      Returns the ID of this test.
      Specified by:
      id in interface Test
      Returns:
      the ID of this test
    • enabledByDefault

      public boolean enabledByDefault()
      Description copied from interface: Test
      Returns if this test is enabled by default.
      Specified by:
      enabledByDefault in interface Test
      Returns:
      if this test is enabled by default
    • visuals

      public Test.Visuals visuals()
      Description copied from interface: Test
      Returns the visual information about the test.
      Specified by:
      visuals in interface Test
      Returns:
      the visual information about the test
    • asGameTest

      @Nullable public @Nullable GameTestData asGameTest()
      Description copied from interface: Test
      Returns the game test version of this test.
      Specified by:
      asGameTest in interface Test
      Returns:
      the game test version of this test
    • listeners

      public Set<TestListener> listeners()
      Description copied from interface: Test
      Returns the listeners of this test.
      Specified by:
      listeners in interface Test
      Returns:
      the listeners of this test
    • groups

      public List<String> groups()
      Description copied from interface: Test
      A list of the groups of this test.
      If this list is empty, the test will be only in the ungrouped group.
      Specified by:
      groups in interface Test
      Returns:
      the groups of this test
    • isEnabled

      public boolean isEnabled()
    • enable

      public void enable()
    • logger

      public org.slf4j.Logger logger()
    • status

      public Test.Status status()
    • updateStatus

      public void updateStatus(Test.Status status, @Nullable @Nullable Entity changer)
    • fail

      protected void fail(String message)
    • pass

      protected void pass()
    • requestConfirmation

      public final void requestConfirmation(Player player, Component message)