From: Morris Keesan on
On Fri, 11 Sep 2009 13:54:38 -0400, markspace <nospam(a)nowhere.com> wrote:

> Morris Keesan wrote:
>
>>>> Integer i = ...;
>>>> Long l = ...;
>>>> assertEquals(i,l); // assertEquals is ambigous, doesnt work
>
>> or simply sidestep the issue by replacing the assertEquals with
>> assertTrue(i == l);
>
>
> Will that work if i and l are objects instead of primitives, as has
> already been indicated?

No. My apologies. I've been dealing with too many different languages,
and I lose track. I was thinking of
assertTrue(i.equals(l)), or assertTrue(l.equals(i))
but looking at the documentation I see that those won't work either,
because Integer.equals() never returns true if its parameter isn't an
Integer, and similarly for Long.equals(), so never mind.

--
Morris Keesan -- mkeesan(a)post.harvard.edu
First  |  Prev  | 
Pages: 1 2 3 4 5 6 7 8 9
Prev: JDK 1.5.0_21 released
Next: LWUIT and J2ME