JUnit parameterized tests: how do I run only 1 specific test from IntelliJ/Eclipse?

I just tested this in Eclipse with a simple parameterized test that always fails on test #4. One is able to right-click on the failed test and select Run. Only that test then executes.

test output

Result:

just test 4

Frustratingly, I can’t see what Eclipse did to solve the problem. Nothing is apparently altered in the run configuration. In particular, if you select to run the configuration a second time, it executes all the tests.

Some further testing shows that Eclipse will regenerate all 10 parameter values, but only uses the 4th value. (This was determined by embedding a print statement in the @Parameters method).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)