Class GameTestArguments
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 Summary
Modifier and TypeMethodDescriptionObject[]Return a defensive copy of the values passed afterGameTestHelper.booleanisNamed()Return whether this invocation has an explicit case name.name()Return the explicit case name, ornullwhen the source position supplies the name.static GameTestArgumentsCreate a named invocation.static GameTestArgumentsnamedValues(String name, Object[] values) Create a named invocation from an explicit values array.static GameTestArgumentsCreate an invocation whose case name is its zero-based position in the method source.static GameTestArgumentsCreate an indexed invocation from an explicit values array.toString()
-
Method Details
-
of
Create an invocation whose case name is its zero-based position in the method source.- Parameters:
first- first value passed to the test method afterGameTestHelper; may benullor an arrayrest- any remaining values
-
ofValues
Create an indexed invocation from an explicit values array.Prefer this factory when any value after the first is
nullor itself an array, because Java varargs cannot distinguish those values without casts.- Parameters:
values- values passed to the test method afterGameTestHelper
-
named
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 afterGameTestHelper; may benullor an arrayrest- any remaining values
-
namedValues
Create a named invocation from an explicit values array.Prefer this factory when any value after the first is
nullor 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 afterGameTestHelper
-
isNamed
public boolean isNamed()Return whether this invocation has an explicit case name. -
name
Return the explicit case name, ornullwhen the source position supplies the name. -
arguments
Return a defensive copy of the values passed afterGameTestHelper. -
toString
-