/// <summary> /// Create the job entry for the saved job. /// </summary> /// <param name="jobid">job id.</param> /// <param name="groupName">the group name.</param> /// <returns>return job.</returns> public Job CreateJobEntry(int jobid, string groupName) { LocalJobProxy p = new LocalJobProxy(); Job job = p.CreateJob(jobid); job.Manager = this; job.GroupName = groupName; job.Status = JobStatus.FINISHED; job.ExecParam = new ExecuteParameter(); m_groupDic[groupName].Jobs.Add(job); return job; }
public void TestGetStdout() { int jobid = 1; string expectedString = null; string resultString = null; JobGroup g = _unitUnderTest.CreateJobGroup("AAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); resultString = _unitUnderTest.GetStdout(g.GroupName, jobid); Assert.AreEqual(expectedString, resultString, "GetStdout method returned unexpected result."); LocalJobProxy proxy = new LocalJobProxy(); Job j = proxy.CreateJob(); j.GroupName = g.GroupName; _unitUnderTest.RegisterJob(j, "", "", new List<string>()); resultString = _unitUnderTest.GetStdout(g.GroupName, j.JobID); Assert.AreEqual("", resultString, "GetStdout method returned unexpected result."); }
public void TestStop() { JobGroup g = _unitUnderTest.CreateJobGroup("AAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); int jobid = 0; _unitUnderTest.Stop(g.GroupName, jobid); LocalJobProxy proxy = new LocalJobProxy(); Job j = proxy.CreateJob(); j.GroupName = g.GroupName; _unitUnderTest.RegisterJob(j, "", "", new List<string>()); _unitUnderTest.Stop(g.GroupName, j.JobID); }
public void TestGetSessionProxy() { int jobid = 0; JobGroup g = _unitUnderTest.CreateJobGroup("AAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); System.Collections.Generic.List<Ecell.Job.Job> expectedList = new List<Job>(); System.Collections.Generic.List<Ecell.Job.Job> resultList = null; resultList = _unitUnderTest.GetSessionProxy(g.GroupName, jobid); Assert.AreEqual(expectedList, resultList, "GetSessionProxy method returned unexpected result."); LocalJobProxy proxy = new LocalJobProxy(); Job j = proxy.CreateJob(); j.GroupName = g.GroupName; _unitUnderTest.RegisterJob(j, "", "", new List<string>()); resultList = _unitUnderTest.GetSessionProxy(g.GroupName, j.JobID); Assert.AreEqual(1, resultList.Count, "GetSessionProxy method returned unexpected result."); }