Skip to content

Commit

Permalink
Replace deprecated -jnlpUrl in JNLPLauncherTest (#8833)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Jan 6, 2024
1 parent 040cb89 commit 7392571
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/src/test/java/hudson/slaves/JNLPLauncherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,21 @@ private ArgumentListBuilder buildJnlpArgs(Computer c) throws Exception {
ArgumentListBuilder args = new ArgumentListBuilder();
args.add(new File(new File(System.getProperty("java.home")), "bin/java").getPath(), "-jar");
args.add(Which.jarFile(Launcher.class).getAbsolutePath());
// TODO deprecated mode
args.add("-jnlpUrl", j.getURL() + "computer/" + c.getName() + "/jenkins-agent.jnlp");
args.add("-url");
args.add(j.getURL());
args.add("-name");
args.add(c.getName());

if (c instanceof SlaveComputer) {
SlaveComputer sc = (SlaveComputer) c;
args.add("-secret");
args.add(sc.getJnlpMac());
ComputerLauncher launcher = sc.getLauncher();
if (launcher instanceof ComputerLauncherFilter) {
launcher = ((ComputerLauncherFilter) launcher).getCore();
} else if (launcher instanceof DelegatingComputerLauncher) {
launcher = ((DelegatingComputerLauncher) launcher).getLauncher();
}
if (launcher instanceof JNLPLauncher) {
args.add(((JNLPLauncher) launcher).getWorkDirSettings().toCommandLineArgs(sc));
}
Expand Down

0 comments on commit 7392571

Please sign in to comment.