-
Notifications
You must be signed in to change notification settings - Fork 3
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
Equals is not fully tested when extending objects #67
Comments
Hy @Santobert, yes this seems like a blind spot. Thanks for bringing it up :) |
Hy @Santobert I have worked on this issue for some time now.
is not the problem. The problem is generating a class that
A class which has the same super class, but not the Child class itself. I would need to create an extending class (an Elephant class for example) on the fly. Java Reflections can not define classes on the fly (at least not to my knowledge). I guess I can get it to work, but this will definitely add a lot of execution time to the tests and I doubt that I can get it to work over all suported Java version (8 - 13) seamlessly. Maybe I don't see the easy solution. |
What do you think about giving the user the option to create this class. That works great for test data providers. Why not for this case as well? |
Yes that is definitely an option. I will look into it. |
Situation
There are two classes that extend each other. The methods
hashCode()
andequals()
were both generated by Eclipse.This is the base test for the class Child:
Issue
The following line in the Childs function
equals()
is not tested:I guess it needs an object that is an instance of
Parent
but not aChild
to test this case.The text was updated successfully, but these errors were encountered: