예제 #1
0
        public void cancelJob()
        {
            BenchmarkDBEntities dbContent = new BenchmarkDBEntities();

            Job testJob = new Job(1, 10, new Owner("TestOwner"), s => "Hello world");
            int jobId = testJob.id;

            BenchmarkSystem.BenchmarkSystem bs = new BenchmarkSystem.BenchmarkSystem();

            bs.submit(testJob);
            bs.cancel(testJob);

            var result = from job in dbContent.DB_JobSet
                         where job.jobId == jobId
                         select job;
            DB_JobSet resultJob = result.First();

            Assert.AreEqual("CANCELLED", resultJob.status);
        }
예제 #2
0
        public void checkStateChange()
        {
            BenchmarkDBEntities dbContent = new BenchmarkDBEntities();

            Job testJob = new Job(1, 10, new Owner("TestOwner"), s => "Hello world");
            int jobId = testJob.id;

            BenchmarkSystem.BenchmarkSystem bs = new BenchmarkSystem.BenchmarkSystem();
            bs.submit(testJob);
            bs.executeAll();

            var result = from job in dbContent.DB_JobLogSet
                         where job.job_jobId == jobId
                         select job.DB_JobSet;

             DB_JobSet resultJob = result.First();

             Assert.AreEqual("DONE", resultJob.status);
        }