Skip to content

Commit d94c408

Browse files
committed
Make test compile with 17
1 parent 4f2bc3a commit d94c408

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ public static void createPropertiesFile(Path propsFilename,
243243
trace("Done");
244244
}
245245

246+
public static void traceFileContents(Path path, String label) throws IOException {
247+
assertFileExists(path);
248+
trace(String.format("Dump [%s] %s...", path, label));
249+
Files.readAllLines(path).forEach(TKit::trace);
250+
trace("Done");
251+
}
252+
246253
public static void createPropertiesFile(Path propsFilename,
247254
Map.Entry<String, String>... props) {
248255
createPropertiesFile(propsFilename, List.of(props));

test/jdk/tools/jpackage/windows/Win8365790Test.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ protected void verify(JPackageCommand cmd) {
102102

103103
private static String runLauncher(JPackageCommand cmd, String launcherName, Path traceFile, Path outputFile) throws IOException {
104104
// Launch the specified launcher and send Ctrl+C signal to it.
105-
Thread.ofVirtual().start(() -> {
105+
Thread t = new Thread (() -> {
106106
configureAndExecute(0, Executor.of("powershell", "-NonInteractive", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "Unrestricted")
107107
.addArgument("-File").addArgument(TEST_PS1)
108108
.addArguments("-TimeoutSeconds", Long.toString(Duration.ofSeconds(5).getSeconds()))
109109
.addArgument("-Executable").addArgument(cmd.appLauncherPath(launcherName))
110110
.dumpOutput());
111111
});
112+
t.start();
112113

113114
TKit.waitForFileCreated(traceFile, Duration.ofSeconds(20), Duration.ofSeconds(2));
114115

0 commit comments

Comments
 (0)