public void TestStoreAndRetrieveTriggers() { var store = new RavenJobStore(); store.SchedulerStarted(); // Store jobs and triggers. for (int i = 0; i < 10; i++) { IJobDetail job = JobBuilder.Create <NoOpJob>().WithIdentity("job" + i).Build(); store.StoreJob(job, true); SimpleScheduleBuilder schedule = SimpleScheduleBuilder.Create(); ITrigger trigger = TriggerBuilder.Create().WithIdentity("trigger" + i).WithSchedule(schedule).ForJob(job).Build(); store.StoreTrigger((IOperableTrigger)trigger, true); } // Retrieve job and trigger. for (int i = 0; i < 10; i++) { JobKey jobKey = JobKey.Create("job" + i); IJobDetail storedJob = store.RetrieveJob(jobKey); Assert.AreEqual(jobKey, storedJob.Key); TriggerKey triggerKey = new TriggerKey("trigger" + i); ITrigger storedTrigger = store.RetrieveTrigger(triggerKey); Assert.AreEqual(triggerKey, storedTrigger.Key); } }
public void TestRetrieveJob_NoJobFound() { var store = new RavenJobStore(); IJobDetail job = store.RetrieveJob(new JobKey("not", "existing")); Assert.IsNull(job); }
public async Task TestStoreAndRetrieveJobs() { var store = new RavenJobStore { Database = "QuartzTest", Urls = "[\"http://localhost:8080\"]" }; await store.Initialize(null, fSignaler); // Store jobs. for (var i = 0; i < 10; i++) { var job = JobBuilder.Create <NoOpJob>().WithIdentity("job" + i).Build(); await store.StoreJob(job, false); } // Retrieve jobs. for (var i = 0; i < 10; i++) { var jobKey = JobKey.Create("job" + i); var storedJob = await store.RetrieveJob(jobKey); Assert.AreEqual(jobKey, storedJob.Key); } }
public async Task TestRetrieveJob_NoJobFound() { var store = new RavenJobStore { Database = "QuartzTest", Urls = "[\"http://localhost:8080\"]" }; await store.Initialize(null, fSignaler); var job = await store.RetrieveJob(new JobKey("not", "existing")); Assert.IsNull(job); }
public void testStoreAndRetrieveJobs() { var store = new RavenJobStore(); // Store jobs. for (int i = 0; i < 10; i++) { IJobDetail job = JobBuilder.Create <NoOpJob>().WithIdentity("job" + i).Build(); store.StoreJob(job, false); } // Retrieve jobs. for (int i = 0; i < 10; i++) { JobKey jobKey = JobKey.Create("job" + i); IJobDetail storedJob = store.RetrieveJob(jobKey); Assert.AreEqual(jobKey, storedJob.Key); } }
public async Task TestStoreAndRetrieveTriggers() { var store = new RavenJobStore { Database = "QuartzTest", Urls = "[\"http://localhost:8080\"]" }; await store.Initialize(null, fSignaler); await store.SchedulerStarted(); // Store jobs and triggers. for (var i = 0; i < 10; i++) { var job = JobBuilder.Create <NoOpJob>().WithIdentity("job" + i).Build(); await store.StoreJob(job, true); var schedule = SimpleScheduleBuilder.Create(); var trigger = TriggerBuilder.Create().WithIdentity("trigger" + i).WithSchedule(schedule).ForJob(job) .Build(); await store.StoreTrigger((IOperableTrigger)trigger, true); } // Retrieve job and trigger. for (var i = 0; i < 10; i++) { var jobKey = JobKey.Create("job" + i); var storedJob = await store.RetrieveJob(jobKey); Assert.AreEqual(jobKey, storedJob.Key); var triggerKey = new TriggerKey("trigger" + i); ITrigger storedTrigger = await store.RetrieveTrigger(triggerKey); Assert.AreEqual(triggerKey, storedTrigger.Key); } }