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

Preliminary support for specifying run order in JUnit5 #3

Draft
wants to merge 1 commit into
base: modifiedRunOrder
Choose a base branch
from

Conversation

amamiya-yuuko-1225
Copy link
Owner

@amamiya-yuuko-1225 amamiya-yuuko-1225 commented Jul 31, 2022

This PR is to show the preliminary implement for [PR???(TO BE FILLED AFTER CREATING THE PR):Specify test order of classes&methods] with JUnit Platform Provider(JUnit5).

The biggest problem to sort test methods in JUnit5 provider is that we need to get all test methods before sorting them.

(Since JUnit5 does not provide a interface like "org.junit.runner.Request#sortWith()" in JUnit4 to help us sort the methods)

Until now, I can only use java reflection to get the methods, and then do the sort job. The pseudo code is like:

List<Method> tests = clazzA.getMethods().filter(non-test methods).sort()
for ( Method m : tests )
	selectors.add( MethodSelector( m ) )

Hopefully you may have a better idea to solve this problem. Looking forward to your reply in order to move this PR forward.

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

Successfully merging this pull request may close these issues.

1 participant