Work Day 25: Fun with GUnit Testing

I’m in GUnit testing hell. My mentor is back. In answer to my confusion he explained that l needed to do a GUnit test, if the pcf code I changed uses Java and Gosu utility classes. It took me a good hour or so to trace through to see where these classes were—sure enough, the pcfs use several utility classes.

I’m not entirely sure I set everything up correctly for the test. All the utility classes are part of Java or Gosu “packages” which l don’t think you put under “gtest.” There was one class not in that category, which appeared to already be in the gtest path. I painstakingly followed all the directions to set up an “All Tests” GUnit run in Guidewire. There were a total of 1008 tests to run—35 failed. I’m not sure what the hell that even means. I suspect I’m going to need to meet with my mentor to figure all this out. There is some sort of mechanism to ignore certain tests, if not applicable. I’m hoping that was the issue—that I just needed to exclude certain non-applicable tests (and not that I’ve managed to screw up the entire application with my two small changes).

I also realized after the fact that I should have written a test to include that would have tested my ACTUAL change. I thought that this was an all-encompassing test, and that my change would be tested with everything else by osmosis or something. If you held a loaded gun at my head, I couldn’t begin to figure out how to write one. I looked at one of the gtest files and it was so confusing I almost fell into a dead faint.

I have this horrible feeling that figuring this out is going to involve another Pluralsight video…

Author: WildKnitter

By day I work for a large insurance company. By night and the rest of my life, I share my life with a spouse, a bossy cat, four step-children, and many, many grandchildren. Also, of course, my mad passion is my knitting and crocheting. My latest adventure is something called Coding Bootcamp!