Exemplo n.º 1
0
        public void TestConstructorLocalJobProxy()
        {
            LocalJobProxy jobProxy = new LocalJobProxy();
            Assert.IsNotNull(jobProxy, "Constructor of type, LocalJobProxy failed to create instance.");
            Assert.AreEqual("Local", jobProxy.Name, "Name is unexpected value.");

            Assert.AreEqual(1, jobProxy.Concurrency, "DefaultConcurrency is unexpected value.");
            jobProxy.Concurrency = 100;
            Assert.AreEqual(100, jobProxy.Concurrency, "DefaultConcurrency is unexpected value.");

            Assert.IsNull(jobProxy.Manager, "Manager is unexpected value.");
            jobProxy.Manager = (JobManager)_env.JobManager;
            Assert.AreEqual(_env.JobManager, jobProxy.Manager, "Manager is unexpected value.");
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public JobManager(ApplicationEnvironment env)
        {
            m_env = env;
            m_timer = new Timer();
            m_timer.Enabled = false;
            m_timer.Interval = m_updateInterval;
            m_timer.Tick += new EventHandler(UpdateTimeFire);

            LocalJobProxy p = new LocalJobProxy();
            p.Manager = this;
            m_proxyList.Add(p.Name, p);

            string cog_home = System.Environment.GetEnvironmentVariable("COG_HOME");
            if (!string.IsNullOrEmpty(cog_home))
            {
                GlobusJobProxy g = new GlobusJobProxy();
                g.Manager = this;
                m_proxyList.Add(g.Name, g);
            }

            SetCurrentEnvironment(p.Name);
            TmpRootDir = Util.GetTmpDir();
        }
Exemplo n.º 4
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
Exemplo n.º 5
0
 public void SetUp()
 {
     _env = new ApplicationEnvironment();
     _unitUnderTest = new LocalJobProxy();
     _unitUnderTest.Manager = (JobManager)_env.JobManager;
 }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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.");
        }
Exemplo n.º 8
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.");
        }