-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Labels
Description
Currently, unit tests depend on JUnit 4 explicitly (downloading it if it is not available):
ros2_java/rcljava_common/cmake/Modules/JavaExtra.cmake
Lines 55 to 67 in 6291847
find_jar(JUNIT_JAR NAMES junit VERSIONS 4) | |
if(${JUNIT_JAR}) | |
list(APPEND exported_jars ${JUNIT_JAR}) | |
else() | |
set(junit_version "4.12") | |
set(junit_sha256 "59721f0805e223d84b90677887d9ff567dc534d7c502ca903c0c2b17f05c116a") | |
set(junit_url "https://repo1.maven.org/maven2/junit/junit/${junit_version}/junit-${junit_version}.jar") | |
set(junit_jar_path "${CMAKE_CURRENT_BINARY_DIR}/jars/junit-${junit_version}.jar") | |
file(DOWNLOAD ${junit_url} ${junit_jar_path} EXPECTED_HASH SHA256=${junit_sha256}) |
By switching to JUnit 5, we can take advantage of new features and the extensibility of it's modular architecture.
At the moment, there aren't many instances I can point to that would justify switching, besides this TODO:
ros2_java/rosidl_generator_java/src/test/java/org/ros2/generator/InterfacesTest.java
Lines 38 to 39 in cf2ef07
// TODO(jacobperron): Replace with JUnit's assertThrows method when we switch to JUnit 5 | |
// See: https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html |
I haven't investigated how easy it would be to switch; it may be as simple as update the CMake snippet referenced above.