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 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);
}
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildVariablesTest method setup.
@Before
public void setup() {
AgentIdentifier agentIdentifier = new AgentIdentifier("duloc", "127.0.0.1", "uuid");
AgentRuntimeInfo runtimeInfo = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, "/home/lord-farquaad/builds", "cookie", false);
bvs = new BuildVariables(runtimeInfo, new TestingClock(new Date(0)));
}
Aggregations