Skip to content

Commit

Permalink
Merge pull request #566 from jglick/webSocket
Browse files Browse the repository at this point in the history
Removing `JNLPLauncher.webSocket` notation in `nodes.md`
  • Loading branch information
jglick authored Aug 12, 2024
2 parents 550b336 + e043173 commit 2032fc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import hudson.remoting.Launcher;
import hudson.remoting.VirtualChannel;
import hudson.security.Permission;
import hudson.slaves.JNLPLauncher;
import hudson.util.IOUtils;
import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -785,9 +784,6 @@ protected void printTo(PrintWriter out, ContentFilter filter) throws IOException
if (node instanceof Slave) {
Slave agent = (Slave) node;
out.println(" - Launch method: " + getDescriptorName(agent.getLauncher()));
if (agent.getLauncher() instanceof JNLPLauncher) {
out.println(" - WebSocket: " + ((JNLPLauncher) agent.getLauncher()).isWebSocket());
}
out.println(" - Availability: " + getDescriptorName(agent.getRetentionStrategy()));
}
Optional.ofNullable(node.toComputer())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,16 @@ public void testAboutJenkinsContent() {
}

@Test
@Issue("JENKINS-65097")
public void testAboutNodesContent() throws Exception {

DumbSlave tcp1 = j.createSlave("tcp1", "test", null);
tcp1.setLauncher(new JNLPLauncher(false));
((JNLPLauncher) tcp1.getLauncher()).setWebSocket(false);
tcp1.setLauncher(new JNLPLauncher());
tcp1.save();

String aboutMdToString = SupportTestUtils.invokeComponentToString(
Objects.requireNonNull(ExtensionList.lookup(Component.class).get(AboutJenkins.class)));
assertThat(aboutMdToString, containsString(" * `" + tcp1.getNodeName() + "` (`hudson.slaves.DumbSlave`)"));
assertThat(aboutMdToString, containsString(" - Launch method: `hudson.slaves.JNLPLauncher`"));
assertThat(aboutMdToString, containsString(" - WebSocket: false"));

((JNLPLauncher) tcp1.getLauncher()).setWebSocket(true);
tcp1.save();

aboutMdToString = SupportTestUtils.invokeComponentToString(
Objects.requireNonNull(ExtensionList.lookup(Component.class).get(AboutJenkins.class)));
assertThat(aboutMdToString, containsString(" * `" + tcp1.getNodeName() + "` (`hudson.slaves.DumbSlave`)"));
assertThat(aboutMdToString, containsString(" - Launch method: `hudson.slaves.JNLPLauncher`"));
assertThat(aboutMdToString, containsString(" - WebSocket: true"));
}

@Test
Expand Down

0 comments on commit 2032fc1

Please sign in to comment.