Consider declaring class for Enclosed tests in Categories #1663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At QueryDSL, we were surprised that Enclosed tests were not run when the category was included as group filter.
It turns out to be because the declaring class is not considered when determining the categories for a particular test. This pull request changes that behaviour to also consider the declaring class.
Example:
Where
AbstractSuite
is annotated with@RunWith(Enclosed.class)
.When
<groups>com.querydsl.core.testutil.H2</groups>
is used, none of the inner test classes is executed, unless they themselves are annotated with@Category(H2.class)
. To us it would make sense that this is implicit.Source: https://github.com/querydsl/querydsl/blob/master/querydsl-sql/src/test/java/com/querydsl/sql/suites/H2LiteralsSuiteTest.java#L9-L16