[Bluej-discuss] Compiler barfs when imported class not specifically named in method call
Hedley Finger
hfinger at handholding.com.au
Thu Oct 25 08:37:01 BST 2007
I wanted to do an assertEquals on the values of two double arrays,
but the standard JUnit methods do not provide this (the object
pointer references are compared and they are NEVER going to be equal).
After installing junit-addons.jar into the BlueJ IDE and adding it to
the list of libraries, I was able to do this:
import junitx.framework.AssertArray;
import junit.framework.Assert;
but calling
assertEquals(double[], double[], double);
causes a compiler error but not with
AssertArray.assertEquals(double[], double[], double);
The latter is just fine with the compiler and, what is more, the test
method even works! 8^)
I am new to Java and could not concoct the Google search that would
lead me to the reasoning for this behaviour. Can anyone tell me why
I need to call the AssertArray class explicitly?
Regards,
Hedley
--
Hedley Stewart Finger
28 Regent Street Camberwell VIC 3124 Australia
Tel. +61 3 9809 1229 Mobile +61 412 461 558,
E-mail <mailto:hfinger at handholding.com.au>
More information about the bluej-discuss
mailing list