MXUnit
MXUnit is a unit testing framework for CFML developers, modeled after other xUnit frameworks (JUnit, etc). MXUnit honors the major XUnit conventions but deviates and enhances to provide a more enjoyable, idiomatic CF test experience.
History
MXUnit was first released in 2007. As of 2013 the current version is v2.1.3 [1] It is the most widely used Unit testing framework in the Coldfusion, Railo and Lucee communities, many examples can be found today not only on the projects website but also on many popular ColdFusion blogs [2]
MXUnit Assertion Example
The below Asserts true if the desired condition is met, otherwise it'll return false indicating the test has failed.
<cffunction name="clearPrivilegesShouldClearPrivilegesFromObject">
<cfset obj = createObject("component","myObject")>
<cfset obj.addPrivilege("EditUsers")>
<cfset assertTrue( StructCount(obj.getPrivileges()), "Guard assertion: Ensure we're starting out with privileges before testing clearPrivileges()")>
<cfset result = obj.clearPrivileges()>
<cfset assertTrue( StructIsEmpty(obj.getPrivileges()), "clearPrivileges Should Have Emptied The Structure of privileges but didn't" )>
</cffunction>
Output Formats
- HTML Format
- ExtJs Format (deprecated)
- XML Format
- JUnit Report XML
- ColdFusion Query Format
- ColdFusion Array format
Platforms and license
Versions 1.x are licensed under GPL and versions 2.x are licensed under the MIT open source license.[3]
MXUnit is supported on Lucee, Railo (Two popular open source CFML engines) and Adobe's Coldfusion application servers.
It has supported IDE plugins for both Eclipse IDE and Sublime Text
See also
CFUnit - an alternate unit testing framework for CFML.
JUnit - JUnit, what MXUnit is modeled after.