BTW, I asked Jim to take a look at this, since he and I worked
together on a hairy equals method a few months ago. Any objections
if, once I get karma, I add the test he mentioned to the test suite?
- A
On Fri, Mar 14, 2003 at 07:28:44AM -0000, [EMAIL PROTECTED] wrote:
>
> ------- Additional Comments From [EMAIL PROTECTED] 2003-03-14 07:28 -------
> No wait, I take it back.
>
> I now see the code which checks for subclasses and
> forces equals to false in the relevant cases.
>
> The tests would probably be a bit clearer if they
> were broken apart in a greater number of test methods,
> with names which reflected the things they did.
> For what it is worth, here's the test I wrote
> which helped me see what was going on:
>
> public void testSubclassingIsCommutative()
> {
> TestObject superObj = new TestObject(4);
> TestSubObject subObj = new TestSubObject(4, 10);
> boolean superFirst = EqualsBuilder.reflectionEquals(superObj, subObj);
> boolean subFirst = EqualsBuilder.reflectionEquals(subObj, superObj);
> assertEquals(superFirst, subFirst);
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
Alex Chaffee mailto:[EMAIL PROTECTED]
Purple Technology - Code and Consulting http://www.purpletech.com/
jGuru - Java News and FAQs http://www.jguru.com/alex/
Gamelan - the Original Java site http://www.gamelan.com/
Stinky - Art and Angst http://www.stinky.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]