Example #1
0
        public void SetUp()
        {
            var successDetail = new DeploymentDetail(() => "success detail", () => new DeploymentResult()
                                                                                       {
                                                                                           new DeploymentItem(DeploymentItemStatus.Good, "verify")
                                                                                       }, () => new DeploymentResult()
                                                                                                    {
                                                                                                        new DeploymentItem(DeploymentItemStatus.Good, "execute")
                                                                                                    }, ()=>new DeploymentResult());

            var failDetail = new DeploymentDetail(() => "fail detail", () => new DeploymentResult()
                                                                                 {
                                                                                     new DeploymentItem(DeploymentItemStatus.Error, "fail verify")
                                                                                 }, () => new DeploymentResult()
                                                                                              {
                                                                                                  new DeploymentItem(DeploymentItemStatus.Good, "execute")
                                                                                              }, ()=>new DeploymentResult());

            var webRole = new DeploymentRole("Web");
            webRole.AddServer(new DeploymentServer("SrvWeb1"));
            webRole.AddServer(new DeploymentServer("SrvWeb2"));
            webRole.ForEachServerMapped(s => s.AddDetail(successDetail));
            var dbRole = new DeploymentRole("Db");
            dbRole.AddServer("SrvDb");
            dbRole.ForEachServerMapped(s => s.AddDetail(failDetail));
            Plan = new DeploymentPlan();
            Plan.AddRole(webRole);
            Plan.AddRole(dbRole);

            BecauseOf();
        }
Example #2
0
            public override void Context()
            {
                base.Context();

                Detail = new DeploymentDetail(() => "test detail", () => new DeploymentResult()
                                                                    {
                                                                        new DeploymentItem(DeploymentItemStatus.Good, "verify")
                                                                    },
                                                                   () => new DeploymentResult()
                                                                    {
                                                                              new DeploymentItem(DeploymentItemStatus.Good, "execute")
                                                                    }
                                                                   , () => new DeploymentResult());

                var webRole = new DeploymentRole("Web");
                webRole.AddServer(new DeploymentServer("SrvWeb1"));
                webRole.AddServer(new DeploymentServer("SrvWeb2"));
                webRole.ForEachServerMapped(s => s.AddDetail(Detail));
                var dbRole = new DeploymentRole("Db");
                dbRole.AddServer("SrvDb");
                dbRole.ForEachServerMapped(s => s.AddDetail(Detail));
                Plan = new DeploymentPlan();
                Plan.AddRole(webRole);
                Plan.AddRole(dbRole);
            }
        public void Execute()
        {
            bool verifyRan = false;
            bool executeRan = false;
            bool traceRan = false;

            var detail = new DeploymentDetail(() =>
            {
                traceRan = true;
                return "trace";
            }, () =>
            {
                verifyRan = true;
                var r = new DeploymentResult();
                r.AddGood("test:v");
                return r;
            }, () =>
            {
                executeRan = true;
                var r = new DeploymentResult();
                r.AddGood("test:e");
                return r;
            },
            ()=> new DeploymentResult());


            var web = new DeploymentRole("WEB");
            web.AddServer("BILL");
            web.ForEachServerMapped(s => s.AddDetail(detail));

            var plan = new DeploymentPlan();
            plan.AddRole(web);


            var args = new DeploymentArguments
                       {
                           Role = "WEB",
                           Command = DeploymentCommands.Execute
                       };

            plan.Execute();

            Assert.IsTrue(traceRan, "trace");
            Assert.IsTrue(verifyRan, "verify");
            Assert.IsTrue(executeRan, "execute");
        }
Example #4
0
        public void SetUp()
        {
            var detail = new DeploymentDetail(() => "test detail", () => new DeploymentResult()
                                                                    {
                                                                        new DeploymentItem(DeploymentItemStatus.Good, "verify")
                                                                    }, () => new DeploymentResult()
                                                                             {
                                                                                 new DeploymentItem(DeploymentItemStatus.Good, "execute")
                                                                             });
            var webRole = new DeploymentRole("Web");
            webRole.AddServer(new DeploymentServer("SrvWeb1"));
            webRole.AddServer(new DeploymentServer("SrvWeb2"));
            webRole.ForEachServer(s=>s.AddDetail(detail));
            var dbRole = new DeploymentRole("Db");
            dbRole.AddServer("SrvDb");
            dbRole.ForEachServer(s => s.AddDetail(detail));
            Plan = new DeploymentPlan();
            Plan.AddRole(webRole);
            Plan.AddRole(dbRole);

            BecauseOf();
        }
 public override void BecauseOf()
 {
     //TODO: not a fan of Inspector.GetPlan - but do I really need to wrap it?
     Plan = Inspector.GetPlan(Deployment);
 }
        public void Trace()
        {
            bool verifyRan = false;
            bool executeRan = false;
            bool traceRan = false;

            var detail = new DeploymentDetail(() =>
            {
                traceRan = true;
                return "trace";
            }, () =>
            {
                verifyRan = true;
                return new DeploymentResult();
            }, () =>
            {
                executeRan = true;
                return new DeploymentResult();
            });

            var web = new DeploymentRole("WEB");
            web.AddServer(new DeploymentServer("bob"));
            web.ForEachServer(s => s.AddDetail(detail));

            var plan = new DeploymentPlan();
            plan.AddRole(web);

            var args = new DeploymentArguments
                       {
                           Role = "WEB",
                           Command = DeploymentCommands.Trace
                       };

            plan.Trace();

            Assert.IsTrue(traceRan);
            Assert.IsFalse(verifyRan);
            Assert.IsFalse(executeRan);
        }
 public override void BecauseOf()
 {
     Plan = Inspector.GetPlan(Deployment);
 }