From: Demyanovich, C. - A. <cde...@ap...> - 2004-01-06 17:37:14
|
Greetings, I'm having problems using MockDirContext.setExpectedSearch(...). Both my test and my code create a SearchControls instance and configure it with the same properties, i.e., two separate instances that are logically equal. However, the test fails with this message: junit.framework.AssertionFailedError: mySearchControls did not receive the expected Value. I learned that MockDirContext.verify(), inherited ultimately from MockObject, relies on the equals() implementation of the various expected and actual fields of MockDirContext. I then decided to test the equals() implementation of SearchControls, and I discovered that it is inherited from java.lang.Object. Therefore, it provides only reference equality and not logical equality. Consequently, MockDirContext.setExpectedSearch(...) doesn't work as desired. If anyone does not agree with my analysis, please correct me. Otherwise, has anyone taken any steps to address this with the Java team in general or the JNDI team in particular? Thanks, Craig <<<<<<<<<<<<< >>>>>>>>>>>>> Craig Demyanovich Software Developer Apogent Technologies, Inc. Tel: 269-544-7514 Fax: 269-544-7409 cdemyanovich @ apogent dot com |