I have a test class that uses org.junit.runners.Parameterized
. How can I identify the full set of parameters out of the set of three that fails in a test in IntelliJ 14?
Asked
Active
Viewed 369 times
2

Martin Schröder
- 4,176
- 7
- 47
- 81
2 Answers
2
The [1]
on the left side is the index of your parameters array that has failed in your test. So go to your test class, look up your parameters for that test, and the second ([1]
in a zero-based array) parameters entry is the one that failed your test.

Darek Kay
- 15,827
- 7
- 64
- 61
1
Each set of parameters has its own name - the [1]
on the left side is that name.
You can use name
argument in @Parameters
to customize that name, for example:
@Parameters(name = "{index}: testAdd({0}+{1}) = {2}")
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][]{
{1, 1, 2},
{2, 2, 4},
});
}
that way, in the square brackets on the left, next to the test name, you will see [0: testAdd(1+1=2)]
and [1: testAdd(2+2=4)]
.
By default name={index}
, and that's why you see [0]
, [1]
... in the square brackets.

aurelia
- 493
- 8
- 12