Skip to content

Commit

Permalink
Remove Bartholdy reference
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Nov 28, 2024
1 parent a0beecb commit ff4d13f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static ProcessStarter java() {
return javaCommand(currentJdkHome(), "java");
}

private static Path currentJdkHome() {
public static Path currentJdkHome() {
var executable = ProcessHandle.current().info().command().map(Path::of).orElseThrow();
// path element count is 3 or higher: "<JAVA_HOME>/bin/java[.exe]"
return executable.getParent().getParent().toAbsolutePath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static platform.tooling.support.process.ProcessStarters.currentJdkHome;
import static platform.tooling.support.tests.Projects.copyToWorkspace;

import java.nio.file.Path;
import java.util.List;
import java.util.Map;

import de.sormuras.bartholdy.tool.Java;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -50,7 +49,7 @@ void java_8() throws Exception {

@Test
void java_default() throws Exception {
var actualLines = execute(new Java().getHome(), MavenEnvVars.FOR_JDK24_AND_LATER);
var actualLines = execute(currentJdkHome(), MavenEnvVars.FOR_JDK24_AND_LATER);

assertTrue(actualLines.contains("[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1"));
}
Expand Down

0 comments on commit ff4d13f

Please sign in to comment.