Class GameTestArguments

java.lang.Object
com.gtnewhorizons.horizonqa.api.GameTestArguments

public final class GameTestArguments extends Object
One invocation supplied by a parameterized game test's method source.

Use named(String, Object, Object...) when the inputs have a stable domain name such as a voltage tier or fluid id. Named invocations use that name in selectors, logs, JUnit XML, and status JSON. of(Object, Object...) creates an invocation named by its zero-based position in the source.

The first argument is a fixed parameter rather than part of the varargs array. Consequently, a single null or array value is preserved as one test argument instead of being confused with a null or expanded varargs array. Use ofValues(Object[]) or namedValues(String, Object[]) when a later value is null or an array.

Rows are snapshots. HorizonQA defensively copies argument arrays, including array-valued arguments, for each launch, but arbitrary object values are not cloned. Prefer immutable descriptors such as ids, names, and numbers; construct mutable game objects inside the test method so interactive reruns cannot observe mutations from an earlier invocation.

  • Method Details

    • of

      public static GameTestArguments of(Object first, Object... rest)
      Create an invocation whose case name is its zero-based position in the method source.
      Parameters:
      first - first value passed to the test method after GameTestHelper; may be null or an array
      rest - any remaining values
    • ofValues

      public static GameTestArguments ofValues(Object[] values)
      Create an indexed invocation from an explicit values array.

      Prefer this factory when any value after the first is null or itself an array, because Java varargs cannot distinguish those values without casts.

      Parameters:
      values - values passed to the test method after GameTestHelper
    • named

      public static GameTestArguments named(String name, Object first, Object... rest)
      Create a named invocation.
      Parameters:
      name - stable case name of at most 128 characters matching [A-Za-z0-9_.-]+
      first - first value passed to the test method after GameTestHelper; may be null or an array
      rest - any remaining values
    • namedValues

      public static GameTestArguments namedValues(String name, Object[] values)
      Create a named invocation from an explicit values array.

      Prefer this factory when any value after the first is null or itself an array, because Java varargs cannot distinguish those values without casts.

      Parameters:
      name - stable case name of at most 128 characters matching [A-Za-z0-9_.-]+
      values - values passed to the test method after GameTestHelper
    • isNamed

      public boolean isNamed()
      Return whether this invocation has an explicit case name.
    • name

      public String name()
      Return the explicit case name, or null when the source position supplies the name.
    • arguments

      public Object[] arguments()
      Return a defensive copy of the values passed after GameTestHelper.
    • toString

      public String toString()
      Overrides:
      toString in class Object