Debugging scripts loaded with GroovyShell (in eclipse)
- by MSh
I am working with eclipse and groovy plug in. I am building a test harness to debug and test groovy scripts. The scripts are really simple but long, most of them just if/else/return. I figured out that I can call them using GroovyShell and Bindings to pass in the values.
The problem is that, while I can call the script and get the results just fine, I CAN NOT step in there with the debugger. Breakpoints in those scripts are not active.
Is there a way to debug the scripts? Maybe I should use something other than GroovyShell?
I really don't want to modify the scripts by wrapping them into functions, and then calling those functions from my test classes.
That's how I am using 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"));