I have a standard Java project that uses ant for building. I would like to add spock testing to this project without disrupting the current process. What is the minimum set of changes that would allow me to start to integrate spock testing into this project.
There is not much available information on spock integration into legacy projects using ant.
If you have a mix of jUnit and Spock tests in your test package (like we do), you can use the joint compilation feature of groovyc
, something like this:
<groovyc srcdir="${testSrcDir}" destdir="${testTarget}" classpathref="testCompileClasspath">
<javac deprecation="on" debug="on"/>
</groovyc>
This will automagically compile both the Java and Groovy tests together. From this point on, you can run the tests as before using the junit
task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With