Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertSame/assertNotSame broken after GITHUB-2296 #2486

Closed
2 of 7 tasks
vdiravka opened this issue Mar 3, 2021 · 5 comments · Fixed by #2487
Closed
2 of 7 tasks

assertSame/assertNotSame broken after GITHUB-2296 #2486

vdiravka opened this issue Mar 3, 2021 · 5 comments · Fixed by #2487
Milestone

Comments

@vdiravka
Copy link
Contributor

vdiravka commented Mar 3, 2021

TestNG Version

7.4.0 (7.3.0 worked fine)

Expected behavior

assertSame(object.clone(), object) returns false

Actual behavior

assertSame(object.clone(), object) returns true

Description

assertSame/assertNotSame should use == operator, but not equals method to compare the same objects to identify they are the same object or different objects

Is the issue reproductible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

public void testAssertNotSame() {
    Contrived object = new Contrived(2);
    Contrived object2 = new Contrived(2);;
    Assert.assertNotSame(object2, object);
}
@vdiravka vdiravka changed the title asserSame broken after GITHUB-2296 assertSame broken after GITHUB-2296 Mar 3, 2021
@vdiravka vdiravka changed the title assertSame broken after GITHUB-2296 assertSame/assertNotSame broken after GITHUB-2296 Mar 3, 2021
@javydreamercsw
Copy link

Was about to report this, thanks!

@Axinet
Copy link

Axinet commented Aug 16, 2021

Are there any plans to release 7.4.1 with this fix? Broken assertion seems like important enough part of test framework to release fix/patch?

@juherr
Copy link
Member

juherr commented Aug 22, 2021

@Axinet Sorry, no plan for a 7.4.1. Do you have an issue with 7.3.0 which is resolved in 7.4.0?

@Axinet
Copy link

Axinet commented Aug 23, 2021

It looked like I have, but after verification (I switched broken assertion to use AssertJ instead of TestNG assertion) it looks like for now 7.3.0 has no drawbacks in compare to 7.4.0. The issue we have is located somewhere elsewhere, although looked similar to one of the solved issues for 7.4.0.
So for me it works with the old version good enough, although I am still surprised that there is no patch planned. Based on thumb ups on my question some other people wonder about it too.

@juherr
Copy link
Member

juherr commented Aug 23, 2021

I am still surprised that there is no patch planned

It is too much effort to deal with many branches. The fix will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants