public void TestClearJob() { JobManager manager = new JobManager(_env); LocalJob.ClearJobID(); JobGroup g = manager.CreateJobGroup("AAAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); int jobID = 0; manager.ClearJob(g.GroupName, jobID); jobID = manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); manager.ClearJob(g.GroupName, jobID); }
public void TestUpdate() { JobManager manager = new JobManager(_env); JobGroup g = manager.CreateJobGroup("AAAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); foreach (Job job in manager.GetFinishedJobList()) job.Status = JobStatus.RUNNING; manager.Update(); }
public void TestRun() { JobManager manager = new JobManager(_env); JobGroup g = manager.CreateJobGroup("AAAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); manager.Run(g.GroupName, true); manager.GroupDic[g.GroupName].Stop(); }
public void TestRegisterJob() { JobManager manager = new JobManager(_env); JobGroup g = manager.CreateJobGroup("AAAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); string script = null; string arg = null; List<string> extFile = null; int expectedInt32 = 1; int resultInt32 = 0; LocalJob.ClearJobID(); int jobid = manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); resultInt32 = manager.RegisterJob(manager.GroupDic[g.GroupName].GetJob(jobid), script, arg, extFile); Assert.AreEqual(expectedInt32, resultInt32, "RegisterJob method returned unexpected result."); manager.Proxy = null; resultInt32 = manager.RegisterJob(null, script, arg, extFile); expectedInt32 = -1; Assert.AreEqual(expectedInt32, resultInt32, "RegisterJob method returned unexpected result."); }
public void TestIsFinished() { JobManager manager = new JobManager(_env); bool expectedBoolean = true; bool resultBoolean = false; resultBoolean = manager.IsFinished(null); Assert.AreEqual(expectedBoolean, resultBoolean, "IsFinished method returned unexpected result."); JobGroup g = manager.CreateJobGroup("AAAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); foreach (Job job in manager.GetFinishedJobList()) job.Status = JobStatus.RUNNING; expectedBoolean = false; resultBoolean = manager.IsFinished(g.GroupName); Assert.AreEqual(expectedBoolean, resultBoolean, "IsFinished method returned unexpected result."); }
public void TestGetFinishedJobList() { JobManager manager = new JobManager(_env); List<Job> expectedList = new List<Job>(); List<Job> resultList = null; resultList = manager.GetFinishedJobList(); Assert.AreEqual(expectedList, resultList, "GetFinishedJobList method returned unexpected result."); JobGroup g = manager.CreateJobGroup("AAAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); manager.CreateJobEntry(g.GroupName, new ExecuteParameter()); resultList = manager.GetFinishedJobList(); Assert.IsNotEmpty(resultList, "GetFinishedJobList method returned unexpected result."); }
public void TestCreateJobEntry() { JobManager manager = new JobManager(_env); LocalJob.ClearJobID(); ExecuteParameter param = new ExecuteParameter(); int expectedInt32 = 1; int resultInt32 = 0; JobGroup g = manager.CreateJobGroup("AAAA", new List<EcellObject>(), new List<Ecell.Objects.EcellObject>()); resultInt32 = manager.CreateJobEntry(g.GroupName, param); Assert.AreEqual(expectedInt32, resultInt32, "CreateJobEntry method returned unexpected result."); manager.Proxy = null; expectedInt32 = -1; resultInt32 = manager.CreateJobEntry(g.GroupName, param); Assert.AreEqual(expectedInt32, resultInt32, "CreateJobEntry method returned unexpected result."); }