After my post about jUnit, decided to have a look at how CFUnit integrates with Eclipse to see how easy or how hard it would be to make it work with cfcUnit.
First off, the CFUnit code is Windows-centric, assuming expanded file paths contain \ instead of testing for both \ and /. That was an easy fix but I really wish ColdFusion developers would think about this issue when they're providing code for others to use!
Second, the Eclipse facade for CFUnit has pretty much zero documentation and next to no comments so it took me a while to figure out that it assumes the facade is actually a test listener. Once I'd figured that out, it was relatively straightforward to convert it over to work with cfcUnit. Up to a point.
Update: I have a fully operational facade CFC for cfcUnit that works smoothly with the CFUnit plugin. I've sent a copy to Robert Blackburn to review and also to Paul Kenney. Once I have their feedback, I'll post the CFC here for folks to download (in a post containing instructions on how to set it up).

3 responses so far ↓
1 Robert Blackburn // Apr 19, 2007 at 8:26 PM
I'm psyched that you got cfcUnit working for this too. I had been trying to keep the facade and integration points as generic as possible to make that sort of conversion easier later. (my apologies for not commenting the facade better; I know, I know, no excuses).
Let me know when it's public and I will be sure to include cfcUnit testing in my future changes to the plugin. Because, as you can see, the CFUnit plug-in has a LONG way to go. I would love to get it working as smoothly as the jUnit runner. I've always been impressed with how easy that is to use and how natural it fits into a developer's workflow. But baby steps I guess :o)
The odd thing is I started getting NULL point expectations for my CFUnit tests too. Which is odd because I was not getting those before and there shouldn't be any recent changes. So I'll have to investigate that as well. Better error handling is obviously one of those things that needs work :o)
2 Sean Corfield // Apr 19, 2007 at 8:55 PM
3 Sana // Apr 20, 2007 at 8:00 AM
Looking forward unit testing in my tool box.
Thanks
Leave a Comment