예제 #1
0
        /// <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;
        }
예제 #2
0
        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.");
        }
예제 #3
0
        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);
        }
예제 #4
0
        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.");
        }