Class InboundAgentFixture

java.lang.Object
org.jvnet.hudson.test.fixtures.InboundAgentFixture

public class InboundAgentFixture extends Object
Manages inbound agents. While these run on the local host, they are launched outside of Jenkins. Usage:

 private static final InboundAgentFixture FIXTURE = InboundAgentFixture.newBuilder().build();

 public void method() {
     try {
         Slave agent = FIXTURE.createAgent(r, […]);
         […]
     } finally {
         FIXTURE.tearDown();
     }
 }
 

To avoid flakiness when tearing down the test, ensure that the agent has gone offline with:


 Slave agent = inboundAgents.createAgent(r, […]);
 try {
     […]
 } finally {
     inboundAgents.stop(r, agent.getNodeName());
 }
See Also: