I work with connecting eclipse and groovy. I am creating a test harness for debugging and testing groovy scripts. The scripts are really simple, but long, most of them are simple if / else / return. I realized that I could call them using GroovyShell and Bindings to pass values.
The problem is that although I can call the script and get the results just fine, I CANNOT step there with the debugger. Breakpoints are inactive in these scenarios.
Is there any way to debug scripts? Maybe I should use something other than GroovyShell? I really do not want to modify the scripts by transferring them to functions and then calling these functions from my test classes.
The way I use Binding and GroovyShell:
def binding = new Binding(); binding.lineList = [list1]; binding.count = 5; def shell = new GroovyShell(binding); def result = shell.evaluate(new File("src/Rules/checkLimit.groovy"));
source share