Skip to content

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.

2 participants