Posted example code on the wiki: http://www.brainopolis.com/castorwiki/Wiki.jsp?page=CastorMockObjects
jeff >>> [EMAIL PROTECTED] 12/03/03 01:31PM >>> Figured out the answer to my own question: CastorJDO cacheing is getting in the way of the mock object expectations, in that because the same object was earlier loaded by Castor into the same JVM as a different unit test, the second test does not actually change the MockPreparedStatement expectation for result sets returned. Solutions to this problem include: * run each unit test in its own JVM (probably the most realistic) * set cache-type type="none" in the mapping.xml file (I did this and it worked) * have each unit test load a unique object so that cacheing collisions do not occur * account for cacheing as part of unit testing (smacks more of integration testing at this point, and it would be very difficult to do in a consistent, simple manner) jeff -- Jeffrey Bonevich Lead Developer, CareWeb University of Michigan Health System Ann Arbor, Michigan mailto: [EMAIL PROTECTED] ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev