linghengqian commented on code in PR #21571:
URL: https://github.com/apache/shardingsphere/pull/21571#discussion_r996325907
##########
pom.xml:
##########
@@ -611,7 +620,13 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junit.version}</version>
+ <version>${junit4.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <version>${junit5.version}</version>
Review Comment:
- Obviously, we don't need anything related to Junit 5 Jupiter. This is
essentially because Junit 4 cannot execute unit tests directly in GraalVM
Native Image.
- Under Junit Platform, `native-maven-plugin` in GraalVM Native Build Tools
provides `VintageConfigProvider`, refer to
https://github.com/graalvm/native-build-tools/blob/master/common/junit-platform-native/src/main/java/org/graalvm/junit/platform/config/vintage/VintageConfigProvider.java
.
- This allows us to continue using the `JUnit 4` API ostensibly, while
actually executing the tests is `JUnit Vintage`. The handling of this process
requires the help of a later version of the `maven-surefire-plugin`.
- This may be a bit difficult to understand. The simple explanation is that
`Junit Platform` manages test platforms such as `Junit4`, `Junit Jupiter` and
`Hamcrest` in a unified manner. The management of `Junit4` by `Junit Platform`
is realized through `JUnit Vintage`. The `GraalVM Native Build Tools` does not
directly deal with the specific engine, but calls the API of the `Junit
Platform` to complete the unit test in the `GraalVM Native Image`.
-

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]