use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildRepositoryMessageProducerTest method shouldDelegatePingToTheOldImplementation.
@Test
public void shouldDelegatePingToTheOldImplementation() {
producer.ping(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false));
verify(oldImplementation).ping(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildRepositoryMessageProducerTest method shouldDelegateReportJobStatusToTheOldImplementation.
@Test
public void shouldDelegateReportJobStatusToTheOldImplementation() {
producer.reportCurrentStatus(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), jobIdentifier, assigned);
verify(oldImplementation).reportCurrentStatus(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), jobIdentifier, assigned);
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildRepositoryMessageProducerTest method shouldDelegateReportJobResultToTheOldImplementation.
@Test
public void shouldDelegateReportJobResultToTheOldImplementation() {
producer.reportCompleting(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), jobIdentifier, passed);
verify(oldImplementation).reportCompleting(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), jobIdentifier, passed);
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class WorkAssignmentsTest method setup.
@Before
public void setup() {
context = new ClassMockery();
idleAgentsTopic = context.mock(IdleAgentTopic.class, "idle_topic");
assignedWorkTopic = context.mock(WorkAssignedTopic.class, "assigned_work_topic");
context.checking(new Expectations() {
{
one(assignedWorkTopic).addListener(with(any(WorkAssignments.class)));
}
});
assignments = new WorkAssignments(idleAgentsTopic, assignedWorkTopic);
agentIdentifier = new AgentIdentifier("localhost", "127.0.0.1", "uuid");
agent = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class WorkFinderTest method shouldPostNoWorkOnException.
@Test
public void shouldPostNoWorkOnException() {
final RuntimeException exception = new RuntimeException("foo");
context.checking(new Expectations() {
{
one(workAssigner).assignWorkToAgent(AGENT_1);
will(throwException(exception));
one(assignedWorkTopic).post(new WorkAssignedMessage(AGENT_1, NO_WORK));
}
});
try {
finder.onMessage(new IdleAgentMessage(new AgentRuntimeInfo(AGENT_1, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false)));
} catch (Exception e) {
assertSame(exception, e);
}
}
Aggregations