Skip to content
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

posixlib unit-tests should use JUnit BeforeClass more consistently. #3697

Closed
LeeTibbert opened this issue Jan 20, 2024 · 0 comments · Fixed by #3698
Closed

posixlib unit-tests should use JUnit BeforeClass more consistently. #3697

LeeTibbert opened this issue Jan 20, 2024 · 0 comments · Fixed by #3698
Assignees

Comments

@LeeTibbert
Copy link
Contributor

Sometimes there is a reason for unit-tests to use the JUnit4 "@before" annotation (that is, run before each test).
Most of the time, an least in the javalib tests I recently had cause to examine, "@BeforeClass" (that is, run once
before each class) is intended. Similar concern with "@after" & "@afterclass" annotation.

posixlib unit-tests should be more consistent with using the "@BeforeClass", if that is what the logic of the
test intends.

In some of the files, there is only one test. So now, the two are equivalent. Once some diligent future maintainer
adds a test, the execution strategy will change/fall_apart.

In the files with more than one Test, there should be some minor improvement in execution speed because the
setup/teardown is done only once per class.

I have a number of irons in the fire, each requiring tending. I did not do a sweep through javalib, etc. to see
if a similar situation exists there. As I am in those projects from time to time, I will take a look when I am there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant