use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentInstanceTest method shouldNotChangePendingAgentIpAddress.
@Test
public void shouldNotChangePendingAgentIpAddress() throws Exception {
AgentInstance pending = AgentInstance.createFromLiveAgent(new AgentRuntimeInfo(agentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), systemEnvironment, mock(AgentStatusChangeListener.class));
AgentRuntimeInfo info = new AgentRuntimeInfo(new AgentIdentifier("ccedev01", "10.18.7.52", "uuid"), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
assertThat(pending.isIpChangeRequired(info.getIpAdress()), is(false));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentDaoTest method shouldUpdateExistingAgentCookieMappingIfOneExists.
@Test
public void shouldUpdateExistingAgentCookieMappingIfOneExists() throws Exception {
AgentIdentifier agentIdentifier = new AgentIdentifier("host", "127.0.0.1", "uuid");
agentDao.associateCookie(agentIdentifier, "cookie");
agentDao.associateCookie(agentIdentifier, "cookie_updated");
assertThat(agentDao.cookieFor(agentIdentifier), is("cookie_updated"));
assertThat(cookieForUuid(), is("cookie_updated"));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentDaoTest method shouldAssociateCookieForAGivenAgent.
@Test
public void shouldAssociateCookieForAGivenAgent() throws Exception {
AgentIdentifier agentIdentifier = new AgentIdentifier("host", "127.0.0.1", "uuid");
agentDao.associateCookie(agentIdentifier, "cookie");
assertThat(agentDao.cookieFor(agentIdentifier), is("cookie"));
assertThat(cookieForUuid(), is("cookie"));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentStatusReportingIntegrationTest method before.
@Before
public void before() {
agentIdentifier = new AgentIdentifier("localhost", "127.0.0.1", "uuid");
environmentVariableContext = new EnvironmentVariableContext();
artifactManipulator = new GoArtifactsManipulatorStub();
buildRepository = new com.thoughtworks.go.remote.work.BuildRepositoryRemoteStub();
this.agentRuntimeInfo = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentConfigServiceTest method shouldEnableAgentWhenPending.
@Test
public void shouldEnableAgentWhenPending() {
String agentId = DatabaseAccessHelper.AGENT_UUID;
AgentConfig agentConfig = new AgentConfig(agentId, "remote-host", "50.40.30.20");
AgentRuntimeInfo agentRuntimeInfo = AgentRuntimeInfo.fromAgent(new AgentIdentifier("remote-host", "50.40.30.20", agentId), AgentRuntimeStatus.Unknown, "cookie", false);
AgentInstance instance = AgentInstance.createFromLiveAgent(agentRuntimeInfo, new SystemEnvironment(), null);
agentConfigService.enableAgents(Username.ANONYMOUS, instance);
shouldPerformCommand(new GoConfigDao.CompositeConfigCommand(new AgentConfigService.AddAgentCommand(agentConfig)));
}
Aggregations