Forum Discussion
It looks like you have tried to make a new instance of a class called Compare, but that class isn't defined or isn't defined properly in the scope of the script.
You may need to post your script to get further help. Or at least the class definition.
class Compare { Compare() { ... } }
Hi JHunt,
Thanks for Responding. I have attached the Groovy Script class and error log. Please help me to fix this error.
Regards,
Ajay Suresh
- JHunt8 years agoCommunity Hero
You have def cpr = new Compare, but you haven't said what a Compare is (or imported it's definition). What is the output that you want? If Compare.stringCompare(string, string) returns a boolean, is your output supposed to be something like "truetruetruetruefalsetruetruetrue"?
Can you use something like this?
def tests = [ ["1", "1"], ["2", "2"], ["3", "4"] ]
tests.each { log.info "Expected ${it[0]}, actual was ${it[1]}, result is " + (it[0] == it[1] ? "PASS" : "FAIL") }INFO:Expected 1, actual was 1, result is PASS
INFO:Expected 2, actual was 2, result is PASS
INFO:Expected 3, actual was 4, result is FAIL
Related Content
- 2 years ago
- 2 years ago
Recent Discussions
- 17 days ago