Do JUnit test suites work in Grails?
I am writing a Groovy/Grails(2.1.2) project using IntelliJ.
Is it possible to run Spock tests as a JUnit test suite? I have tried:
package com.foo
import com.foo.functional.SampleFunctionalSpec
import org.junit.experimental.categories.Categories
import org.junit.runner.RunWith
import org.junit.runners.Suite
@RunWith(Categories.class)
@Categories.IncludeCategory(Category1.class)
@Suite.SuiteClasses( {SampleFunctionalSpec.class} )
class SampleTestSuite {
}
and
package com.foo.functional
import com.foo.*
import org.junit.experimental.categories.Category;
@Category(Category1.class)
class SampleFunctionalSpec extends BloomGebSpecCase {
def "Sample test 1 with Category1"() {
given:
when:
println "when"
then:
println "Sample test 1 with Category1"
}
}
and
package com.foo
interface Category1 { }
and I get "Unable to attach test reporter to test framework..." when I run grails test-app functional SampleTestSuite
from within IntelliJ.
EDIT: Also, just running a test suite with no categories gives same "Unattached" problem:
@RunWith(Suite.class)
@Suite.SuiteClasses( SampleFunctionalSpec.class )
class SampleTestSuite { }