You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the expected output? What do you see instead?
Look at the covered lines and you will notice there is one branch missing coverage for the 1st property of the bean: this is because the value generator checks for two values for all beans but it does not start with a hashcode test without any value which means the case where all fields are null is not tested, hence the missed branch.
What version of the product are you using? On what operating system?
bean-matchers 0.9
Please provide any additional information below.
Of course, if the first property is a basic type such as an int, the coverage will ok. This is a workaround for some beans. The real issue happens when the bean only has objects like the "Name" example.
The text was updated successfully, but these errors were encountered:
orien
changed the title
Test coverage incomplete in hashcode : AbstractBeanHashCodeMatcher.hashCodeIsInfluencedByProperties does not check 1st property with null value
Test coverage incomplete in hashcode
Jan 9, 2021
migrated from google code issue 1
AbstractBeanHashCodeMatcher.hashCodeIsInfluencedByProperties
does not check 1st property with null value. The test coverage is incomplete.What steps will reproduce the problem?
Create a java bean with at least two object properties. E.g.
In eclipse, using the eclemma test coverage tool (or simply using the debugger in "Name" hashCode): run the following unit test:
What is the expected output? What do you see instead?
Look at the covered lines and you will notice there is one branch missing coverage for the 1st property of the bean: this is because the value generator checks for two values for all beans but it does not start with a hashcode test without any value which means the case where all fields are null is not tested, hence the missed branch.
Now, add this test:
Run again and the coverage is now 100%
What version of the product are you using? On what operating system?
bean-matchers 0.9
Please provide any additional information below.
Of course, if the first property is a basic type such as an int, the coverage will ok. This is a workaround for some beans. The real issue happens when the bean only has objects like the "Name" example.
The text was updated successfully, but these errors were encountered: