Forum Discussion
ajaysuresh
8 years agoOccasional Contributor
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
JHunt
8 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
- 18 days ago