[JWebUnit-development] [ jwebunit-Bugs-3116839 ] assertTitleNotSame works incorrectly
Brought to you by:
henryju
|
From: SourceForge.net <no...@so...> - 2010-11-23 18:54:48
|
Bugs item #3116839, was opened at 2010-11-23 13:52 Message generated for change (Settings changed) made by tonyqian You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3116839&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tony Qian (tonyqian) >Assigned to: Julien HENRY (henryju) Summary: assertTitleNotSame works incorrectly Initial Comment: 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. * * @param title * unexpected title value */ But this method calls Assert.assertNotSame(title, getTestEngine().getPageTitle()); Assert.assertNotSame calls following method static public void assertNotSame(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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3116839&group_id=61302 |