Managed Hosting



Project Home Blog Forums Wiki Known Issues Contact Project

Author: Michael Steele (All RIAForge projects by this author)
Last Updated: March 22, 2010 3:21 PM
Version: 3.5b
Views: 127,694
Downloads: 1,791
License: Apache License, Version 2


CFEasyMock v3.5 and Reflect
1) Allows the user to create partial mocks
2) Creates a more robust proxy, allowing for intra-component method calls to be handled properly by onMissingMethod.

CFCoverage beta.
Allows you to review code coverage by unit tests.
Bug Fixes.
Refactored into a single directory.

Matchers allow for more flexibility when setting expected function behavior.
NEW! Added TransferMockFactory to create mocks directly from a transfer.xml configuration file.

CFEasyMock allows you to not only create simple mock objects for use in unit testing frameworks like cf[c]Unit and MXUnit, but also actually verify the behaviour of functions under test when interacting with the mock(s).

Behavioural mocks allow you to:
1. Declare the expected behaviour of your function under test.
2. Record the actual behavior of your function under test.
3. Verify that the expected and actual behaviours match.

This is very useful if you have methods that don't return values, or have complex logic in your function under test.

Expected method calls now evaluate function parameters based on matchers rather than direct value comparison.
MXUnit integration to make it easier to use CFEasyMock within MXUnit
Updated documentation

v1.5.01 fixes a bug:
The TransferMockFactory was not creating the ID accessor methods correctly

Version 1.5 adds new functionality:
- easymock.ext.transfer package allows for direct creation of mocks of components created by the Transfer ORM framework.
- modifies the MockFactory to use the 2.5 version of reflect (included)
- updated documentation
- SVN updated!!!

Version 1.2.2 fixes a couple of bugs:
-Edge case where passing arguments as an argument collection where at least on of the arguments was not required and not passed to the method was throwing a java.nullpointerexception
-java.lang.String was returned as the component name where the behavior failed
-Ignore whitespace in string comparisons
-expectLastCall() was creating a new behavior instead of modifying the previous method call
-Removed the debug function and replaced with trace(). See documentation
-Fixed the sample code and changed to tests to demonstrate easymock and different test outcomes.

Version 1.2 adds speed enhancements (most noticeable on CF8) by moving various internal comparison methods into the MockFactory, rather than requiring the creation of a separate component instance for each expected method call.

Recent Blog Entries:


requires CF8.

Issue Tracker:

8 partial mocks - 'setMockedMethods' not found Closed 03/22/10 1:40 PM
7 return type typo in MockFactoryFacade Fixed 09/18/09 12:01 PM
6 MockFactory cfc path typo in docs Fixed 09/18/09 12:01 PM
5 MockFactory expect / expectLastCall confusion Fixed 12/15/08 6:31 PM
4 Error if CFC has no methods Closed 04/18/08 5:09 PM

View All Issues

To enter issues for this (or any other) project, you must be logged in.

Subversion Access:

You may access this project's Subversion repository with your client here: http://svn.riaforge.org/cfeasymock.

To view files and changelists associated with this repository, go here: http://cfeasymock.riaforge.org/index.cfm?event=page.svnbrowse.

Anonymous users have read access to the repository while the administrator has write access.

This project is sharing its code via Subversion. Subversion is an open source source control method. You may find more information about Subversion here: http://subversion.tigris.org/