示例#1
0
        public void SetUp()
        {
            foo1 = new JobStatusDTO {
                JobKey = "1", NodeName = "foo"
            };
            foo2 = new JobStatusDTO {
                JobKey = "2", NodeName = "foo"
            };
            foo3 = new JobStatusDTO {
                JobKey = "3", NodeName = "foo"
            };
            bar1 = new JobStatusDTO {
                JobKey = "1", NodeName = "bar"
            };
            bar2 = new JobStatusDTO {
                JobKey = "2", NodeName = "bar"
            };

            thePersistence = new InMemorySchedulePersistence();
            thePersistence.Persist(new[] { foo1, foo2, foo3, bar1, bar2 });

            theLogger = new RecordingLogger();

            theStatusMonitor = new ScheduleStatusMonitor(theChannelGraph, new ScheduledJobGraph(), thePersistence, theLogger, SystemTime.Default());
        }
        public void SetUp()
        {
            runtime = FubuRuntime.BasicBus();
            runtime.Get <IContainer>().UseInMemoryDatastore();

            thePersistence = runtime.Get <RavenDbSchedulePersistence>();

            foo1 = new JobStatusDTO {
                JobKey = "1", NodeName = "foo"
            };
            foo2 = new JobStatusDTO {
                JobKey = "2", NodeName = "foo"
            };
            foo3 = new JobStatusDTO {
                JobKey = "3", NodeName = "foo"
            };
            bar1 = new JobStatusDTO {
                JobKey = "1", NodeName = "bar"
            };
            bar2 = new JobStatusDTO {
                JobKey = "2", NodeName = "bar"
            };

            thePersistence.Persist(new[] { foo1, foo2, foo3, bar1, bar2 });
        }
示例#3
0
        public void SetUp()
        {
            runtime = FubuTransport.DefaultPolicies().StructureMap().Bootstrap();
            runtime.Factory.Get <IContainer>().UseInMemoryDatastore();

            thePersistence = runtime.Factory.Get <RavenDbSchedulePersistence>();

            foo1 = new JobStatusDTO {
                JobKey = "1", NodeName = "foo"
            };
            foo2 = new JobStatusDTO {
                JobKey = "2", NodeName = "foo"
            };
            foo3 = new JobStatusDTO {
                JobKey = "3", NodeName = "foo"
            };
            bar1 = new JobStatusDTO {
                JobKey = "1", NodeName = "bar"
            };
            bar2 = new JobStatusDTO {
                JobKey = "2", NodeName = "bar"
            };

            thePersistence.Persist(new[] { foo1, foo2, foo3, bar1, bar2 });
        }
示例#4
0
        public JobStatusDTO Find(string nodeName, string jobKey)
        {
            var id = JobStatusDTO.ToId(nodeName, jobKey);

            using (var session = _store.OpenSession())
            {
                return(session.Load <JobStatusDTO>(id));
            }
        }
        private void addJobRow(TableRowTag row, JobStatusDTO job, IUrlRegistry urls)
        {
            row.Cell().Add("a").Text(job.JobKey).Attr("href", urls.UrlFor(new ScheduledJobRequest {
                Job = job.JobKey
            }));
            row.Cell(job.NextTime.HasValue ? job.NextTime.Value.ToLocalTime().ToString() : "Not scheduled");
            row.Cell(job.GetStatusDescription());
            row.Cell(job.GetLastExecutionDescription());

            var url = urls.UrlFor(new RunJobRequest {
                Name = job.JobKey
            });

            row.Cell().Add("button").Text("Execute").Attr("data-url", url).AddClass("button").AddClass("executor").Attr("onclick", "if (window.confirm('Ok to run this job?')) window.location='" + url + "'");
        }
        public void persist_job_status()
        {
            foo1.Status = foo2.Status = foo3.Status = bar1.Status = bar2.Status = JobExecutionStatus.Inactive;

            var change = new JobStatusDTO {
                JobKey = "1", NodeName = "foo", Status = JobExecutionStatus.Scheduled
            };

            thePersistence.Persist(change);

            thePersistence.FindAllActive("foo")
            .ShouldHaveTheSameElementsAs(change);

            thePersistence.Find("foo", "1").ShouldBeTheSameAs(change);
        }
        public void SetUp()
        {
            foo1 = new JobStatusDTO {
                JobKey = "1", NodeName = "foo"
            };
            foo2 = new JobStatusDTO {
                JobKey = "2", NodeName = "foo"
            };
            foo3 = new JobStatusDTO {
                JobKey = "3", NodeName = "foo"
            };
            bar1 = new JobStatusDTO {
                JobKey = "1", NodeName = "bar"
            };
            bar2 = new JobStatusDTO {
                JobKey = "2", NodeName = "bar"
            };

            thePersistence = new InMemorySchedulePersistence();
            thePersistence.Persist(new [] { foo1, foo2, foo3, bar1, bar2 });
        }
示例#8
0
 public void Persist(JobStatusDTO status)
 {
     _transaction.Execute <IDocumentSession>(session => { session.Store(status); });
 }