Ensure @Nested classes are executed after sibling test methods by marcphilipp · Pull Request #4603 · junit-team/junit-framework (original) (raw)
In order to validate them, classpath scanning was changed to find them
in 5.13.0. However, that caused @Nested classes to be added to their
parent descriptors before their sibling test methods. This made the
order of execution in classes containing nested test classes dependent
on how they were discovered unless a MethodOrderer was configured in
which case MethodOrderingVisitor ensured test methods came before
@Nested test classes on the same level.
This commit changes MethodOrderingVisitor to also ensure this
ordering constraint in case no MethodOrderer is configured.
Resolves #4600.
marcphilipp deleted the marc/4600-ensure-nested-class-order branch
marcphilipp added a commit that referenced this pull request
In order to validate them, classpath scanning was changed to find them
in 5.13.0. However, that caused @Nested classes to be added to their
parent descriptors before their sibling test methods. This made the
order of execution in classes containing nested test classes dependent
on how they were discovered unless a MethodOrderer was configured in
which case MethodOrderingVisitor ensured test methods came before
@Nested test classes on the same level.
This commit changes MethodOrderingVisitor to also ensure this
ordering constraint in case no MethodOrderer is configured.
Resolves #4600.
(cherry picked from commit d0d6071)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})