Class ScenarioTestInfo

java.lang.Object
fr.fidorial.testing.ScenarioTestInfo

@Internal public final class ScenarioTestInfo extends Object
The running state of one ScenarioTestInstance, ticked by the server test runner.
Since:
0.1.0
  • Constructor Details

    • ScenarioTestInfo

      public ScenarioTestInfo(ScenarioTestInstance instance, World world, ScenarioTestPlayerFactory playerFactory)
      Prepares a test run.
      Parameters:
      instance - the test to run
      world - the world the test runs in
      playerFactory - the factory of the mock players the test summons
      Since:
      0.1.0
  • Method Details

    • tick

      public int tick()
      Returns the tick the test last ran at.
      Returns:
      the tick the test last ran at
      Since:
      0.1.0
    • state

      public ScenarioTestInfo.State state()
      Returns the current state of the test.
      Returns:
      the current state of the test
      Since:
      0.1.0
    • instance

      public ScenarioTestInstance instance()
      Returns the test being run.
      Returns:
      the test being run
      Since:
      0.1.0
    • error

      public @Nullable Throwable error()
      Returns the failure of the test, or null unless it failed.
      Returns:
      the failure of the test, or null unless it failed
      Since:
      0.1.0
    • isDone

      public boolean isDone()
      Returns true once the test passed or failed.
      Returns:
      true once the test passed or failed
      Since:
      0.1.0
    • tick

      public void tick(int currentTick)
      Advances the test: invokes the test method on the first call, then ticks its sequence until it completes, fails or times out.
      Parameters:
      currentTick - the number of ticks elapsed since the test started
      Since:
      0.1.0