Example #1
0
        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.");
        }