From 7392571c65a2431832856fca941e0f1d035b228b Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 6 Jan 2024 09:07:08 -0800 Subject: [PATCH] Replace deprecated `-jnlpUrl` in `JNLPLauncherTest` (#8833) --- .../test/java/hudson/slaves/JNLPLauncherTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java index 813c72364558..e71b2fbcce9c 100644 --- a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java +++ b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java @@ -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)); }