Search in sources :

Example 16 with Work

use of com.thoughtworks.go.remote.work.Work in project gocd by gocd.

the class BuildAssignmentServiceIntegrationTest method shouldUpdateNumberOfActiveRemoteAgentsAfterAssigned.

@Test
public void shouldUpdateNumberOfActiveRemoteAgentsAfterAssigned() {
    AgentConfig agentConfig = AgentMother.remoteAgent();
    configHelper.addAgent(agentConfig);
    fixture.createPipelineWithFirstStageScheduled();
    buildAssignmentService.onTimer();
    AgentInstance agent = agentService.findAgent(agentConfig.getUuid());
    assertFalse(agent.isBuilding());
    Work work = buildAssignmentService.assignWorkToAgent(agent(agentConfig));
    assertThat(work, instanceOf(BuildWork.class));
    assertTrue(agent.isBuilding());
}
Also used : BuildWork(com.thoughtworks.go.remote.work.BuildWork) Work(com.thoughtworks.go.remote.work.Work) DeniedAgentWork(com.thoughtworks.go.remote.work.DeniedAgentWork) BuildWork(com.thoughtworks.go.remote.work.BuildWork)

Aggregations

Work (com.thoughtworks.go.remote.work.Work)16 BuildWork (com.thoughtworks.go.remote.work.BuildWork)10 NoWork (com.thoughtworks.go.remote.work.NoWork)7 DeniedAgentWork (com.thoughtworks.go.remote.work.DeniedAgentWork)6 AgentIdentifier (com.thoughtworks.go.remote.AgentIdentifier)4 AgentInstance (com.thoughtworks.go.domain.AgentInstance)3 Test (org.junit.Test)3 AgentConfig (com.thoughtworks.go.config.AgentConfig)1 BuildSettings (com.thoughtworks.go.domain.BuildSettings)1 JobInstance (com.thoughtworks.go.domain.JobInstance)1 JobPlan (com.thoughtworks.go.domain.JobPlan)1 UnregisteredAgentException (com.thoughtworks.go.domain.exception.UnregisteredAgentException)1 Message (com.thoughtworks.go.websocket.Message)1 TransactionStatus (org.springframework.transaction.TransactionStatus)1 TransactionCallbackWithoutResult (org.springframework.transaction.support.TransactionCallbackWithoutResult)1