You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The challenge is to define Checkstyle rules that prevent the use of types such as org.junit.Assert and org.junit.Assume in src/main/java while simultaneously allowing their use in src/test/java.
In addition, the rules cannot be too restrictive since spring-test actually depends on various JUnit APIs.
If we implement such rules, the implementation may require the introduction of a special checkstyle.xml file that is only applied to src/main. Furthermore, we likely should only apply these special rules to spring-test.
In addition, we may want to ensure that we do not accidentally use improper APIs from JUnit Jupiter and TestNG -- for example, their assertion libraries -- in src/main for spring-test.
Deliverables
Introduce Checkstyle rules to prevent improper use of testing/assertion APIs (except where needed in spring-test).
JUnit 3: junit.framework.* (src/main and src/test)
JUnit 4: org.junit.* (src/main and src/test)
JUnit Jupiter:org.junit.jupiter.api.Assertions and org.junit.jupiter.api.Assumptions (src/main and src/test)
TestNG: org.testng.* (src/main and src/test)
Hamcrest: org.hamcrest.* (src/main and src/test)
The text was updated successfully, but these errors were encountered:
It appears that a lot of this work has already been achieved by piecemeal inclusion of various Checkstyle rules over the course of the past month or so.
@philwebb In light of that, I'll assign this to myself to investigate further.
Uh oh!
There was an error while loading. Please reload this page.
Overview
This issue is a follow up to #22932.
The challenge is to define Checkstyle rules that prevent the use of types such as
org.junit.Assert
andorg.junit.Assume
insrc/main/java
while simultaneously allowing their use insrc/test/java
.In addition, the rules cannot be too restrictive since
spring-test
actually depends on various JUnit APIs.If we implement such rules, the implementation may require the introduction of a special
checkstyle.xml
file that is only applied tosrc/main
. Furthermore, we likely should only apply these special rules tospring-test
.In addition, we may want to ensure that we do not accidentally use improper APIs from JUnit Jupiter and TestNG -- for example, their assertion libraries -- in
src/main
forspring-test
.Deliverables
Introduce Checkstyle rules to prevent improper use of testing/assertion APIs (except where needed in
spring-test
).junit.framework.*
(src/main
andsrc/test
)org.junit.*
(src/main
andsrc/test
)org.junit.jupiter.api.Assertions
andorg.junit.jupiter.api.Assumptions
(src/main
andsrc/test
)org.testng.*
(src/main
andsrc/test
)org.hamcrest.*
(src/main
andsrc/test
)The text was updated successfully, but these errors were encountered: