A coworker has recently introduced Spock unit testing into our team's project, and I'm having an annoying problem with its Eclipse integration: whenever we create a parametrized test and use the @Unroll annotation on it, the Eclipse JUnit view loses the association with the test class and shows the results under "Unrooted Tests."
For instance, the results for this test class:
package test
import spock.lang.Specification
import spock.lang.Unroll
class TestSpockTest extends Specification {
def "Not Unrolled Test"() {
when: "something"
then: "one equals one"
1 == 1
}
@Unroll
def "Unrolled Test #param"(Integer param) {
when: "something"
then: "a numer equals itself"
param == param
where:
param << [1, 2, 3]
}
}
Display this way:
How can I get the unrolled test cases (e.g. "Unrolled Test 1") to show up under "test.TestSockTest" like "Not Unrolled Test"? Is there some naming convention for my Spock tests that the Eclipse JUnit plugin will understand?
I'm using:
- Eclipse Kepler SR1
- spock-core-0.7-groovy-2.0
- Jspresso Spock Plugin 2.71
- Groovy-Eclipse plugin 2.8
- JUnit 4.8.2