Exemplo n.º 1
0
        public void AddWorkerShouldCreateJob()
        {
            string name            = MethodBase.GetCurrentMethod().Name;
            JobConductorService fm = GetTestJobConductor(name);
            string jobName         = "Job_".RandomLetters(4);

            Expect.IsFalse(fm.JobExists(jobName));

            fm.AddWorker(typeof(TestWorker).AssemblyQualifiedName, "worker", jobName);

            Expect.IsTrue(fm.JobExists(jobName));
        }
Exemplo n.º 2
0
        public void GetJobShouldCreateNewJob()
        {
            string name            = MethodBase.GetCurrentMethod().Name;
            JobConductorService fm = GetTestJobConductor(name);

            Expect.IsFalse(fm.JobExists(name));
            JobConf validate = fm.GetJob(name);

            Expect.IsNotNull(validate);
            Expect.AreEqual(name, validate.Name);
            Expect.IsTrue(fm.JobExists(validate.Name));
            Expect.IsTrue(File.Exists(validate.GetFilePath()));
        }
Exemplo n.º 3
0
        public void GetJobShouldReturnExistingJob()
        {
            string name = MethodBase.GetCurrentMethod().Name;
            JobConductorService orch = GetTestJobConductor(name);

            Expect.IsFalse(orch.JobExists(name));
            JobConf conf = orch.CreateJob(name);

            Expect.IsTrue(orch.JobExists(name));

            JobConf validate = orch.GetJobConf(name);

            Expect.IsNotNull(validate);
            Expect.AreEqual(name, validate.Name);
        }
Exemplo n.º 4
0
        public void ExistsShouldBeTrueAfterCreate()
        {
            string name            = MethodBase.GetCurrentMethod().Name;
            JobConductorService fm = GetTestJobConductor(name);
            string testJobName     = name + "_JobName_".RandomLetters(4);

            fm.CreateJob(testJobName);
            Expect.IsTrue(fm.JobExists(testJobName));
        }
Exemplo n.º 5
0
        public void CreateJobShouldThrowExceptionIfItExists()
        {
            string name            = MethodBase.GetCurrentMethod().Name;
            JobConductorService fm = GetTestJobConductor(name);
            string testJobName     = name + "_JobName_".RandomLetters(4);

            fm.CreateJob(testJobName);
            Expect.IsTrue(fm.JobExists(testJobName));
            Expect.Throws(() =>
            {
                fm.CreateJob(testJobName);
            }, "Should have thrown an exception but didn't");
        }