Friday, December 4, 2009

java.lang.IllegalArgumentException: can only set expectations on mock objects

This is a wierd error which really does not have a prescriptive solution. When it occured to me I just meddling with the Test Code adding the @After annotation along with a tearDown method which was not there earlier. Magically it worked. It now works even without a @After method.

My environment is a class that extends BaseManagerMockTestCase from Appfuse. Other threads that are out there do not give a complete solution either:

http://markmail.org/thread/wuom2q6mshwz247y#query:java.lang.IllegalArgumentException%3A%20can%20only%20set%20expectations%20on%20mock%20objects+page:1+mid:pzyjgutuwksexjxe+state:results

No comments:

Post a Comment