-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Junit | Can we add @Inherited to org.junit.experimental.categories.Category annotation #398
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
Comments
What would be then the backwards compatibility when super class has category? |
I definitely chose the wrong nick name for github :) Greetings Am 18.03.2012, 17:11 Uhr, schrieb Tibor17
|
Thanks for the reply Tibor. What about allowing subclasses to override the superclass category ? But here again, the surefire-plugin code needs to be changed to honor the new behavior, if at all its modified. Thanks, -----Original Message----- what would be then the backwards compatibility when super class has category? Reply to this email directly or view it on GitHub: |
What if someone already uses class inheritance and the nowadays Category annotation on methods and very super type -except for the rest of sub types. |
Agreed. The behavior will change. -----Original Message----- What if someone already uses class inheritance and the nowadays Category annotation on methods and very super type -except for the rest of sub types. Reply to this email directly or view it on GitHub: |
Nevertheless the junit core might be able to accomplish the inheritance in other way, but you have to find out some concept via junit annotations and get an agreement in the community. |
I also have an issue with not having But what does someone expect if a base class for the tests is annotated with |
Fixed by #566, will be released in 4.12. |
Hi,
We use junit 4.10 along with maven-surefire-plugin. For running all integration tests that belong to a particular category. without @inherited annotation in org.junit.experimental.categories.Category, maven-surefire-plugin requires each test case to be annotated individually.
It would be great to have the support of running all test cases that extend the parent class which has a specified category annotation , instead of requiring each test class to have that category annotation.
I agree that changes can be made at surefire-plugin side to explicitly look for the annotation in the parent class, submitted a patch to surefire-plugin for the same: https://jira.codehaus.org/browse/SUREFIRE-829 , but things will be cleaner if @inherited is added to Category class in junit itself.
What are the disadvantages of this approach ? (If Category annotation is used only for grouping tests, this would be a good approach. Wouldnt it? )
Can you please let me know which one is better ?
Thanks,
Gayathri
The text was updated successfully, but these errors were encountered: