[JWebUnit-users] Re : a question regarding assertTitleNotSame
Brought to you by:
henryju
From: Julien H. <he...@ya...> - 2010-11-23 14:40:30
|
Hi Tony, As I can't say it is a feature, I guess it's a bug Could you please submit a bug on Sourceforge? Thanks Julien ________________________________ De : "Qian, Daqi" <dq...@ca...> À : jwe...@li... Envoyé le : Mar 23 novembre 2010, 14h 57min 07s Objet : [JWebUnit-users] a question regarding assertTitleNotSame All, I have a question regarding assertTitleNotSame(String title). Accroding to javadoc, this method is to check if the page title is not equal to the value of title passed in the method. /** * Assert title of current html page in conversation is not * equal to another value. * * @paramtitle * unexpected title value */ But this method calls Assert.assertNotSame(title, getTestEngine().getPageTitle()); Assert.assertNotSame calls following method staticpublicvoidassertNotSame(String message, Object expected, Object actual) { if(expected == actual) failSame(message); } As you can see, we are comparing references (addresses in memory), not string values. Therefore, assertTitleNotSame(String title) always succeeds. Thanks, Tony Confidentiality Notice: This electronic message transmission, including any attachment(s), may contain confidential, proprietary, or privileged information from Chemical Abstracts Service (“CAS”), a division of the American Chemical Society (“ACS”). If you have received this transmission in error, be advised that any disclosure, copying, distribution, or use of the contents of this information is strictly prohibited. Please destroy all copies of the message and contact the sender immediately by either replying to this message or calling 614-447-3600. |