예제 #1
0
        public void TestThatPreCompileExecutesSuccessfully()
        {
            var operation = new PreCompileOperation("MyWebApp", @"C:\temp\MyWebApp", @"C:\temp\MyWebAppCompiled", _buildManager.Object);

            var status = new StatusReporter();
            operation.Execute(status, new ConDepConfig(), new ConDepOptions("", false, false, false));

            Assert.That(status.HasErrors, Is.False);
            _buildManager.Verify(manager => manager.PrecompileApplication(It.IsAny<PreCompileCallback>()));
        }
예제 #2
0
파일: AceTests.cs 프로젝트: brigs/ConDep
 public void Test()
 {
     var config = new LoadBalancerConfig
                      {
                          Name = "https://10.64.6.74:8443/anm/OperationManager",
                          UserName = "******",
                          Password = "******"
                      };
     var loadBalancer = new AceLoadBalancer_Anm_v41(config);
     var status = new StatusReporter();
     loadBalancer.BringOffline("z63os2swb01-t", "test_env_FARM", LoadBalancerSuspendMethod.Suspend, status);
 }
예제 #3
0
        public void TestThatRoundRobinLoadBalancingGoesOnlineOfflineInCorrectOrder()
        {
            var config = new ConDepConfig { EnvironmentName = "bogusEnv" };
            var server1 = new ServerConfig { Name = "jat-web01" };
            var server2 = new ServerConfig { Name = "jat-web02" };
            var server3 = new ServerConfig { Name = "jat-web03" };
            var server4 = new ServerConfig { Name = "jat-web04" };
            var server5 = new ServerConfig { Name = "jat-web05" };

            config.Servers = new[] { server1, server2, server3, server4, server5 };

            var infrastructureSequence = new InfrastructureSequence();
            var preOpsSequence = new PreOpsSequence(new WebDeployHandlerMock());
            var loadBalancer = new MockLoadBalancer { Mode = LbMode.RoundRobin };

            var remoteSequence = new RemoteSequence(infrastructureSequence, preOpsSequence, config.Servers, loadBalancer);

            var status = new StatusReporter();
            remoteSequence.Execute(status, new ConDepOptions(false, "", false, true, false, false, null));

            Assert.That(loadBalancer.OnlineOfflineSequence.Count, Is.EqualTo(config.Servers.Count * 2));

            Assert.That(loadBalancer.OnlineOfflineSequence[0].Item1, Is.EqualTo("jat-web01"));
            Assert.That(loadBalancer.OnlineOfflineSequence[0].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[1].Item1, Is.EqualTo("jat-web02"));
            Assert.That(loadBalancer.OnlineOfflineSequence[1].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[2].Item1, Is.EqualTo("jat-web03"));
            Assert.That(loadBalancer.OnlineOfflineSequence[2].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[3].Item1, Is.EqualTo("jat-web01"));
            Assert.That(loadBalancer.OnlineOfflineSequence[3].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[4].Item1, Is.EqualTo("jat-web02"));
            Assert.That(loadBalancer.OnlineOfflineSequence[4].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[5].Item1, Is.EqualTo("jat-web03"));
            Assert.That(loadBalancer.OnlineOfflineSequence[5].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[6].Item1, Is.EqualTo("jat-web04"));
            Assert.That(loadBalancer.OnlineOfflineSequence[6].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[7].Item1, Is.EqualTo("jat-web05"));
            Assert.That(loadBalancer.OnlineOfflineSequence[7].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[8].Item1, Is.EqualTo("jat-web04"));
            Assert.That(loadBalancer.OnlineOfflineSequence[8].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[9].Item1, Is.EqualTo("jat-web05"));
            Assert.That(loadBalancer.OnlineOfflineSequence[9].Item2, Is.EqualTo("online"));
        }
예제 #4
0
        public void TestThatRoundRobinLoadBlancingWithOneServerAndContinueWorks()
        {
            var config = new ConDepConfig { EnvironmentName = "bogusEnv" };
            var server1 = new ServerConfig { Name = "jat-web01" };

            config.Servers = new[] { server1 };

            var infrastructureSequence = new InfrastructureSequence();
            var preOpsSequence = new PreOpsSequence(new WebDeployHandlerMock());
            var loadBalancer = new MockLoadBalancer { Mode = LbMode.RoundRobin };

            var remoteSequence = new RemoteSequence(infrastructureSequence, preOpsSequence, config.Servers, loadBalancer);

            var status = new StatusReporter();
            remoteSequence.Execute(status, new ConDepOptions(false, "", false, true, false, true, null));

            Assert.That(loadBalancer.OnlineOfflineSequence.Count, Is.EqualTo(1));

            Assert.That(loadBalancer.OnlineOfflineSequence[0].Item1, Is.EqualTo("jat-web01"));
            Assert.That(loadBalancer.OnlineOfflineSequence[0].Item2, Is.EqualTo("online"));
        }
예제 #5
0
 public void Test()
 {
     var loadBalancer = new AceLoadBalancer_Anm_v41("104170-ace", "*******");
     var status = new StatusReporter();
     loadBalancer.BringOffline("z63os2swb01-t", "test_env_FARM", LoadBalancerSuspendMethod.Suspend, status);
 }
예제 #6
0
        public void TestThatStickyWithContinueAfterManualTestOnSpecificServerExecutesOnCorrectServers()
        {
            var config = new ConDepConfig { EnvironmentName = "bogusEnv" };
            var server1 = new ServerConfig { Name = "jat-web01" };
            var server2 = new ServerConfig { Name = "jat-web02" };
            var server3 = new ServerConfig { Name = "jat-web03", StopServer = true };
            var server4 = new ServerConfig { Name = "jat-web04" };
            var server5 = new ServerConfig { Name = "jat-web05" };

            config.Servers = new[] { server1, server2, server3, server4, server5 };

            var infrastructureSequence = new InfrastructureSequence();
            var preOpsSequence = new PreOpsSequence(new WebDeployHandlerMock());
            var loadBalancer = new MockLoadBalancer { Mode = LbMode.Sticky };

            var remoteSequence = new RemoteSequence(infrastructureSequence, preOpsSequence, config.Servers, loadBalancer);

            var status = new StatusReporter();
            remoteSequence.Execute(status, new ConDepOptions(false, "", false, true, false, true, null));

            Assert.That(loadBalancer.OnlineOfflineSequence.Count, Is.EqualTo(((config.Servers.Count - 1) * 2) + 1));

            Assert.That(loadBalancer.OnlineOfflineSequence[0].Item1, Is.EqualTo("jat-web03"));
            Assert.That(loadBalancer.OnlineOfflineSequence[0].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[1].Item1, Is.EqualTo("jat-web01"));
            Assert.That(loadBalancer.OnlineOfflineSequence[1].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[2].Item1, Is.EqualTo("jat-web01"));
            Assert.That(loadBalancer.OnlineOfflineSequence[2].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[3].Item1, Is.EqualTo("jat-web02"));
            Assert.That(loadBalancer.OnlineOfflineSequence[3].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[4].Item1, Is.EqualTo("jat-web02"));
            Assert.That(loadBalancer.OnlineOfflineSequence[4].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[5].Item1, Is.EqualTo("jat-web04"));
            Assert.That(loadBalancer.OnlineOfflineSequence[5].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[6].Item1, Is.EqualTo("jat-web04"));
            Assert.That(loadBalancer.OnlineOfflineSequence[6].Item2, Is.EqualTo("online"));

            Assert.That(loadBalancer.OnlineOfflineSequence[7].Item1, Is.EqualTo("jat-web05"));
            Assert.That(loadBalancer.OnlineOfflineSequence[7].Item2, Is.EqualTo("offline"));

            Assert.That(loadBalancer.OnlineOfflineSequence[8].Item1, Is.EqualTo("jat-web05"));
            Assert.That(loadBalancer.OnlineOfflineSequence[8].Item2, Is.EqualTo("online"));
        }
예제 #7
0
        public void TestThatStickyLoadBalancingGoesOnlineOfflineInCorrectOrder()
        {
            var config = new ConDepConfig { EnvironmentName = "bogusEnv" };
            var server1 = new ServerConfig { Name = "jat-web01" };
            var server2 = new ServerConfig { Name = "jat-web02" };
            var server3 = new ServerConfig { Name = "jat-web03" };
            var server4 = new ServerConfig { Name = "jat-web04" };
            var server5 = new ServerConfig { Name = "jat-web05" };

            config.Servers = new[] { server1, server2, server3, server4, server5 };

            var infrastructureSequence = new InfrastructureSequence();
            var preOpsSequence = new PreOpsSequence(new WebDeployHandlerMock());
            var loadBalancer = new MockLoadBalancer { Mode = LbMode.Sticky };

            var remoteSequence = new RemoteSequence(infrastructureSequence, preOpsSequence, config.Servers, loadBalancer);

            var status = new StatusReporter();
            remoteSequence.Execute(status, new ConDepOptions(false, "", false, true, false, false, null));

            Assert.That(loadBalancer.OnlineOfflineSequence.Count, Is.EqualTo(config.Servers.Count * 2));

            var serverNumber = 1;
            for (int i = 0; i < loadBalancer.OnlineOfflineSequence.Count; i += 2)
            {
                Assert.That(loadBalancer.OnlineOfflineSequence[i].Item1, Is.EqualTo("jat-web0" + serverNumber));
                Assert.That(loadBalancer.OnlineOfflineSequence[i].Item2, Is.EqualTo("offline"));

                Assert.That(loadBalancer.OnlineOfflineSequence[i + 1].Item1, Is.EqualTo("jat-web0" + serverNumber));
                Assert.That(loadBalancer.OnlineOfflineSequence[i + 1].Item2, Is.EqualTo("online"));
                serverNumber++;
            }
        }