-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Unexpected Behaviour: assertEquals for Iterable #543
Comments
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 9, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 9, 2017
Extract parameterized test methods in AbstractTestQueries to address differences between cassandra and other connectors. See testng-team/testng#543.
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 9, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 9, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 9, 2017
This prevents false positive test results when comparing iterables (most notably: MaterializedResult instances) due to TestNG bug (testng-team/testng#543). False-positive results were found in ~20 tests and are fixed in the following commits.
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
Extract parameterized test methods in AbstractTestQueries to address differences between cassandra and other connectors. See testng-team/testng#543.
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
This prevents false positive test results when comparing iterables (most notably: MaterializedResult instances) due to TestNG bug (testng-team/testng#543). False-positive results were found in ~20 tests and are fixed in the following commits.
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
Extract parameterized test methods in AbstractTestQueries to address differences between cassandra and other connectors. See testng-team/testng#543.
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
lucesape
pushed a commit
to repairnator/repairnator-experiments
that referenced
this issue
Apr 13, 2017
This prevents false positive test results when comparing iterables (most notably: MaterializedResult instances) due to TestNG bug (testng-team/testng#543). False-positive results were found in ~20 tests and are fixed in the following commits.
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
Extract parameterized test methods in AbstractTestQueries to address differences between cassandra and other connectors. See testng-team/testng#543.
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
This prevents false positive test results when comparing iterables (most notably: MaterializedResult instances) due to TestNG bug (testng-team/testng#543). False-positive results were found in ~20 tests and are fixed in the following commits.
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
Extract parameterized test methods in AbstractTestQueries to address differences between cassandra and other connectors. See testng-team/testng#543.
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
lucesape
pushed a commit
to surli/librepair-XP
that referenced
this issue
Apr 16, 2017
This prevents false positive test results when comparing iterables (most notably: MaterializedResult instances) due to TestNG bug (testng-team/testng#543). False-positive results were found in ~20 tests and are fixed in the following commits.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
assertEquals( Iterable a, Iterable b )
usses it's own equals implementation and ignores existing equals methods.Consider something like: (no real java code, I know)
assertEquals( myClass1, myClass2 )
now doesn't takemyValue
into account because it doesn't use the equals method but it's own implementation of that so it will report some objects as equal even if they aren't.So in order to compare some objects which implement
Iterable
you have to useassertTrue( myClass1.equals( myClass2 ) )
(which will fail misserably if myClass1 is null) orassertEquals( (Object) myClass1, (Object) myClass2 )
I think this is neither obvious nor does the documentation help much because I think nearly noone will read every single documentation for
assertEquals
in case it does something unexpected.In contrast e.g. AssertJ's
assertThat( myClass1 ).isEqualTo( myClass2 )
uses equals method onIterable
, too.The sensible thing to do would be to use the objects equals method even for Iterable (which does compare the content in the right way, anyway) and only if this fails use some means of inspection to report which part did fail.
The text was updated successfully, but these errors were encountered: