JobManager implements Serializable { public AgentTestStartData registerAgentForJob(AgentData agent) { AgentTestStartData ret = null; JobInfo jobInfo = agentMap.get(agent.getJobId()); if (jobInfo != null) { synchronized (jobInfo) { ret = new AgentTestStartData(jobInfo.scripts, jobInfo.getUsers(agent), jobInfo.jobRequest.getRampTime()); ret.setAgentInstanceNum(jobInfo.agentData.size()); ret.setDataFiles(getDataFileRequests(jobInfo)); ret.setJobId(agent.getJobId()); ret.setSimulationTime(jobInfo.jobRequest.getSimulationTime()); ret.setStartUsers(jobInfo.jobRequest.getBaselineVirtualUsers()); ret.setTotalAgents(jobInfo.numberOfMachines); ret.setUserIntervalIncrement(jobInfo.jobRequest.getUserIntervalIncrement()); jobInfo.agentData.add(agent); CloudVmStatus status = vmTracker.getStatus(agent.getInstanceId()); if(status != null) { status.setVmStatus(VMStatus.pending); vmTracker.setStatus(status); } if (jobInfo.isFilled()) { startTest(jobInfo); } } } return ret; }  synchronized void startJob(int id); AgentTestStartData registerAgentForJob(AgentData agent); FutureTask<AgentData> sendCommand(String instanceId, WatsAgentCommand cmd);  }
@Test public void testRegisterAgentForJob_1() throws Exception { JobManager fixture = new JobManager(); AgentData agent = new AgentData("", "", "", 1, VMRegion.ASIA_1, ""); AgentTestStartData result = fixture.registerAgentForJob(agent); assertEquals(null, result); }
@Test public void testRegisterAgentForJob_2() throws Exception { JobManager fixture = new JobManager(); AgentData agent = new AgentData("", "", "", 1, VMRegion.ASIA_1, ""); AgentTestStartData result = fixture.registerAgentForJob(agent); assertEquals(null, result); }
@Test public void testRegisterAgentForJob_3() throws Exception { JobManager fixture = new JobManager(); AgentData agent = new AgentData("", "", "", 1, VMRegion.ASIA_1, ""); AgentTestStartData result = fixture.registerAgentForJob(agent); assertEquals(null, result); }