Ok, now I get what the problem was so for anybody who wants to use
parameterized tests a short clarification:

1) The factory method returns arguments for the constructor:

@ParametersFactory
public static Iterable<Object[]> parameters() { ... }

2) the constructor is, for example:

public MySuiteClass(Integer param1, Integer param2) {

3) RandomizedRunner will create a tree of tests where each method will
have sub-nodes corresponding to parameters passed to the constructor.
To make these tests legible, parameters must supply a sensible (and
short!) toString() because that's what's used in test naming. So if
parameters were two Integers: 2 and 3, the tests would be named:

method {p0=2 p1=3}

The "p0" and "p1" are parameter names which are, unfortunately,
missing from java reflection API (cannot be extracted at runtime even
if they're present in the debug symbols). For naming them to something
more sensible you can use @Name annotation. In the above example we
could use:

public MySuiteClass(@Name("param1") Integer param1, @Name("param2"
Integer param2) {

which would result in tests named:

method {param1=2 param2=3}

Hopefully it's clearer now.

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to