-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
@BeforeClass of superclass is not executed #394
Comments
The method in the superclass is shadowed by the method with the same name in the subclass. If you give the @BeforeClass methods different names, they will run in the correct order. |
thanks taral, issue is settled then. A little mention in the javadoc of @BeforeClass could be helpful though. |
I learnt the same thing the hard way. As @gonzen has said a little mention in javadoc could help us avoid the situation altogether. If it makes sense I can add it in the javadoc and submit a patch. |
@amalakar, a javadoc patch would definitely be appreciated! |
…class overrides/shadows superclass methods
Here is the pull request: https://github.com/KentBeck/junit/pull/504 |
… special case when subclass overrides/shadows superclass methods
[Issue #394] Added javadoc mentioning special case when subclass overrides/shadows superclass methods
Me too. |
I with there was some big note on: http://junit.sourceforge.net/javadoc/org/junit/Before.html saying that you should see http://junit.org/javadoc/latest/ instead, + a link to the new docs from the readme. |
Contrary to the statement in
@BeforeClass
annotation javadoc :/** The @BeforeClass methods of superclasses will be run before those the current class. */
The
@BeforeClass
annotated method of superclass is not called if there is another@BeforeClass
is subclass.The text was updated successfully, but these errors were encountered: