But image.getDefaultModel().getObject() will throw NPE because the default model is, by default, set to null. The ResourceReference is not the default model object.
Why does Image declare getImageResourceReference as protected and not public ? Bruno Nicolas Castin-3 wrote: > > A solution has been found by mbosteels.dns. > > When I did my tests, I discovered that lot of Wicket classes weren't > implementing the equals() method, but ResourceReference do implement it. > If > I set my Image using a ResourceReference, I can create an assertEquals > statement in my JUnit test and compare the > image.getDefaultModel().getObject() with an instance of ResourceReference > I > create in my test with the expected value. > Have a good day > On Thu, Nov 27, 2008 at 9:32 AM, Nicolas Castin > <[email protected]>wrote: > >> Hello, >> >> I am writing a JUnit test for a Wicket page containing some images added >> dynamically. My test needs to detect which images as been rendered, but >> the >> org.apache.wicket.markup.html.image.Image class doesn't expose any method >> to >> get it's resource. >> >> I can extend the class to have a public method giving me the resource, >> but >> I can't imagine that there aren't another way to do this. >> >> Thanks for your help. >> >> Nicolas Castin >> Senior Software Developer >> EURid.eu >> >> > > > -- > Nicolas Castin > Senior Software Developer > EURid.eu > > -- View this message in context: http://www.nabble.com/JUnit-testing-Image-problem-tp20703576p25423238.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
