use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class AgentInstanceTest method shouldNotifyAgentChangeListenerOnRefreshAndMarkedMissing.
@Test
public void shouldNotifyAgentChangeListenerOnRefreshAndMarkedMissing() throws Exception {
AgentInstance agentInstance = AgentInstance.createFromConfig(agentConfig("abc"), new SystemEnvironment(), agentStatusChangeListener);
agentInstance.idle();
agentInstance.refresh();
assertThat(agentInstance.getStatus(), is(AgentStatus.Missing));
verify(agentStatusChangeListener, times(2)).onAgentStatusChange(agentInstance);
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class AgentInstanceTest method shouldNotifyAgentChangeListenerOnUpdate.
@Test
public void shouldNotifyAgentChangeListenerOnUpdate() throws Exception {
AgentInstance idleAgent = AgentInstance.createFromConfig(agentConfig("abc"), new SystemEnvironment(), agentStatusChangeListener);
idleAgent.update(buildingRuntimeInfo());
verify(agentStatusChangeListener).onAgentStatusChange(idleAgent);
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class AgentInstanceTest method shouldNotifyAgentChangeListenerOnAgentBuilding.
@Test
public void shouldNotifyAgentChangeListenerOnAgentBuilding() throws Exception {
AgentInstance idleAgent = AgentInstance.createFromConfig(agentConfig("abc"), new SystemEnvironment(), agentStatusChangeListener);
idleAgent.building(new AgentBuildingInfo("running pipeline/stage/build", "buildLocator"));
verify(agentStatusChangeListener).onAgentStatusChange(idleAgent);
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class AgentInstanceTest method shouldNotifyAgentChangeListenerOnCancel.
@Test
public void shouldNotifyAgentChangeListenerOnCancel() throws Exception {
AgentInstance agentInstance = AgentInstance.createFromConfig(agentConfig("abc"), new SystemEnvironment(), agentStatusChangeListener);
agentInstance.cancel();
verify(agentStatusChangeListener).onAgentStatusChange(agentInstance);
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class AgentInstanceTest method tearDown.
@After
public void tearDown() throws Exception {
FileUtils.deleteQuietly(new File("config/agentkeystore"));
new SystemEnvironment().setProperty("agent.connection.timeout", "300");
new SystemEnvironment().clearProperty(SystemEnvironment.AGENT_SIZE_LIMIT);
}
Aggregations