| Beginners Installation, Coding Techniques, Data... | CF Powered Sites Stores, Directories, Universities... | Developers Developers, Designers, Experts... | E-commerce Shoes, Food, Music... | Expert LiveChat , CFX XMLParser, User Defined Function... | Education Books, Online Resource, Languages... | Hosting Dedicated Servers, Virtual Server, Multi-user... | Intermediate AutoResize, Guestbook... | | | Recent Articles | Switching From cfcUnit to MXUnit As many folks know, I've long been an advocate of Paul Kenney's cfcUnit unit testing framework. I felt it offered the most solid code base and the best all-round feature set in a package that was idiomatic for ColdFusion... Fusion Authority Quarterly Update Magazine The Fusion Authority Quarterly Update (FAQ-U) is a print publication dedicated to collecting the best and most useful technical articles of high interest to ColdFusion developers. Each issue is based on a theme. Kotek's Transfer Decorator Bean Injector Brian Kotek has released his Transfer decorator bean injector observer which I'm very excited about because I just needed this functionality for a client's project... | | 04.02.08 CFEasyMock on RIAForge By Sean Corfield As a fan of unit testing, I was interested to hear about a new mock object generator project appearing in the CF world. I've been using Brian Kotek's ColdMock for a while and I really like how easy it makes it to test CFCs that depend on several other CFCs - because you can create "mock" versions of those CFCs on the fly that return specific values. Mock objects are a good way to provide a consistent environment for your CFCs under test, as well as a way to let your CFCs be tested without them affected the "real" environment (because you can create a "mock" environment which can even include things such as data access objects to fake the whole database layer). As I blogged recently, I've switched from cfcUnit to MXUnit and the mailing list is pretty active. Mike Steele posted that he had ported EasyMock to CFML. My first reaction was "Have you looked at Brian Kotek's ColdMock project?" and Mike explained that EasyMock isn't just about creating simple mock objects but about verifying behavior in those mock objects. Intrigued, I read about EasyMock, a Java project that targets JUnit, and realized the power of being able to create mock objects that expect to be called in certain ways and can, as part of your unit test, actually verify the calls made on them! I asked Mike to send me a build and I played with it and liked it a lot, pretty much instantly. I sent him some feedback and very soon I got an updated build that incorporated much of my feedback - and a note saying he was already going in that direction. Nice to find a project where I'm on the same page as the author! You can download the latest build from the CFEasyMock project page on RIAForge. It's a very simple but very powerful concept that should really help you with your unit testing! Comments About the Author: Sean is currently Senior Computer Scientist and Team Lead in the Hosted Services group at Adobe Systems Incorporated. He has worked in the IT industry for nearly twenty-five years, first in database systems and compilers (serving eight years on the ANSI C++ Standards Committee), then in mobile telecoms, and finally in web development. Sean is a staunch advocate of software standards and best practices, and is a well-known and respected speaker on these subjects. Sean has championed and contributed to a number of ColdFusion frameworks, and is a frequent publisher on his blog, http://corfield.org/ |
0 comments:
Post a Comment