()
| 428 | |
| 429 | #[test] |
| 430 | fn find_java_binary_detects_managed_runtime_layout() { |
| 431 | let root = create_test_dir("jre_find_java_binary"); |
| 432 | let java_name = if OS == "windows" { "java.exe" } else { "java" }; |
| 433 | let java_path = root.join("jdk-21").join("bin").join(java_name); |
| 434 | |
| 435 | fs::create_dir_all(java_path.parent().unwrap()).unwrap(); |
| 436 | File::create(&java_path).unwrap(); |
| 437 | |
| 438 | let detected = find_java_binary(&root); |
| 439 | |
| 440 | assert_eq!(detected, Some(java_path)); |
| 441 | |
| 442 | fs::remove_dir_all(&root).unwrap(); |
| 443 | } |
| 444 | |
| 445 | #[test] |
| 446 | fn find_java_binary_ignores_non_bin_locations() { |
nothing calls this directly
no test coverage detected