コード例 #1
0
ファイル: MsmqTest.cs プロジェクト: GorelH/dropkick
        public void VerifyLocal()
        {
            var ps = new DeploymentServer(Environment.MachineName);
            var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test" };
            var t = new CreateLocalMsmqQueueTask(ps, new QueueAddress(ub.Uri));
            var r = t.VerifyCanRun();

            Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create verification.");
        }
コード例 #2
0
        public void Bob()
        {
            var settings = new TestSettings();
            settings.Bob = "dru";
            settings.Environment = "PROD";
            HUB.Settings = settings;
            _proto = new ProtoCopyFileTask(new DotNetPath(), "C:\\from\\here");
            _proto.ToDirectory("C:\\to\\there\\{{Environment}}");
            _serv = new DeploymentServer("bob");

            _proto.RegisterRealTasks(_serv);
        }
コード例 #3
0
ファイル: CopyFileTest.cs プロジェクト: GorelH/dropkick
        public void CopyFileToUncDirectory()
        {
            var toDir = @"\\srvtestmachine\some_directory";
            var fromDir = @".\bob";
            HUB.Settings = new object();

            var proto = new ProtoCopyFileTask(new DotNetPath(), fromDir);
            proto.ToDirectory(toDir);

            var server = new DeploymentServer("dru");

            proto.RegisterRealTasks(server);
        }
コード例 #4
0
ファイル: MsmqTest.cs プロジェクト: oriacle/dropkick
        public void Execute()
        {
            var ps = new DeploymentServer("srvtestweb01");
            var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test" };
            var address = new QueueAddress(ub.Uri);

            //delete the remote queue

            var t = new CreateRemoteMsmqQueueTask(ps, address);
            var r = t.Execute();

            Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create execution.");
        }
コード例 #5
0
ファイル: MsmqTest.cs プロジェクト: oriacle/dropkick
        public void ExecuteLocal()
        {
            var ps = new DeploymentServer(Environment.MachineName);
            var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test2" };
            var address = new QueueAddress(ub.Uri);

            if (MessageQueue.Exists(address.LocalName))
                MessageQueue.Delete(address.LocalName);

            var t = new CreateLocalMsmqQueueTask(ps, address);
            var r = t.Execute();

            Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create execution.");
        }
コード例 #6
0
            public override void Context()
            {
                base.Context();

                server = new DeploymentServer("127.0.0.1");

                var ub = new UriBuilder("msmq", "127.0.0.1")
                {
                    Path = "dk_test_remote"
                };
                address = new QueueAddress(ub.Uri);

                task = new RemoteMsmqGrantReadWriteTask(server, address, user);
            }
コード例 #7
0
            public override void Context()
            {
                base.Context();
                keyLocation = dotNetPath.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Microsoft", "Crypto", "RSA", "MachineKeys");

                groups = new List<string>
                {
                    WellKnownSecurityRoles.Users
                };

                PhysicalServer server =new DeploymentServer("localhost");
                task = new GrantReadCertificatePrivateKeyTask(server,groups, thumbprint, StoreName.My, StoreLocation.LocalMachine, dotNetPath);
                certificate = BaseSecurityCertificatePermissionsTask.FindCertificateBy(thumbprint, StoreName.My, StoreLocation.LocalMachine, server,result);
            }
コード例 #8
0
ファイル: PathConverterSpecs.cs プロジェクト: GorelH/dropkick
            public string test_share_name(string shareName, string destination)
            {
                var serverName = "localhost";
                if (!Directory.Exists(destination))
                {
                    Directory.CreateDirectory(destination);
                }
                Win32Share.Create(serverName, shareName, destination, "");

                var server = new DeploymentServer(serverName);
                var actual = path.GetPhysicalPath(server, @"~\{0}".FormatWith(shareName),false);

                Win32Share.Delete(serverName, shareName);

                Assert.AreEqual(System.IO.Path.GetFullPath(destination), actual);

                return actual;
            }
コード例 #9
0
ファイル: MsmqTest.cs プロジェクト: GorelH/dropkick
        public void ExecuteLocal()
        {
            var ps = new DeploymentServer(Environment.MachineName);
            var ub = new UriBuilder("msmq", ps.Name) { Path = "dk_test2" };
            var address = new QueueAddress(ub.Uri);

            if (MessageQueue.Exists(address.LocalName))
                MessageQueue.Delete(address.LocalName);

            var t = new CreateLocalMsmqQueueTask(ps, address, transactional:true);
            var r = t.Execute();

            Assert.IsFalse(r.ContainsError(), "Errors occured during MSMQ create execution.");

            var queue =
                MessageQueue.GetPrivateQueuesByMachine(Environment.MachineName).SingleOrDefault(
                    x => address.LocalName.EndsWith(x.QueueName));
            Assert.IsNotNull(queue, "Transactional queue was not created.");
            Assert.IsTrue(queue.Transactional, "Queue was created but is not transactional.");
        }
コード例 #10
0
        public void test_share_name(string shareName)
        {
            string serverName = "localhost";
            string destination = @".\temp";
            if (!Directory.Exists(destination)) { Directory.CreateDirectory(destination); }
            Win32Share.Create(serverName, shareName, destination, "");

            var server = new DeploymentServer(serverName);
            var actual = _path.ConvertUncShareToLocalPath(server, @"~\{0}".FormatWith(shareName));

            Win32Share.Delete(serverName, shareName);

            Assert.AreEqual(System.IO.Path.GetFullPath(destination), actual);
        }
コード例 #11
0
 public void AddServer(DeploymentServer server)
 {
     _servers.Add(server);
 }
コード例 #12
0
ファイル: DotNetPathTests.cs プロジェクト: oriacle/dropkick
 public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_has_an_underscore_in_it()
 {
     var server = new DeploymentServer("localhost");
     Assert.AreEqual(@"C:\code", _path.ConvertUncShareToLocalPath(server, @"~\code_"));
 }
コード例 #13
0
ファイル: TestProtoServer.cs プロジェクト: GorelH/dropkick
 void ProtoServer.MapTo(DeploymentServer server)
 {
     throw new NotImplementedException();
 }
コード例 #14
0
 public void LocalhostShouldBeLocal()
 {
     var srv = new DeploymentServer("localhost");
     Assert.IsTrue(srv.IsLocal);
 }
コード例 #15
0
ファイル: DotNetPathTests.cs プロジェクト: GorelH/dropkick
 public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_is_prepended_with_the_server()
 {
     var server = new DeploymentServer("localhost");
     Assert.AreEqual(@"C:\temp", _path.GetPhysicalPath(server, @"\\localhost\c$\temp", false));
 }
コード例 #16
0
ファイル: DotNetPathTests.cs プロジェクト: GorelH/dropkick
 public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_has_a_dollar_sign_in_it()
 {
     var server = new DeploymentServer("localhost");
     Assert.AreEqual(@"C:\temp", _path.GetPhysicalPath(server, @"~\c$\temp", false));
 }
コード例 #17
0
ファイル: DeploymentRole.cs プロジェクト: GorelH/dropkick
 public void AddServer(DeploymentServer server)
 {
     _servers.Add(server);
 }
コード例 #18
0
ファイル: PathConverterSpecs.cs プロジェクト: GorelH/dropkick
 public override void Context()
 {
     base.Context();
     server = new DeploymentServer(remoteServerName);
 }
コード例 #19
0
ファイル: DotNetPathTests.cs プロジェクト: oriacle/dropkick
 public void when_converting_a_share_to_a_local_path_it_should_work_when_the_share_is_prepended_with_a_tilda_aka_site_root()
 {
     var server = new DeploymentServer("localhost");
     Assert.AreEqual(@"C:\temp", _path.ConvertUncShareToLocalPath(server, @"~\c$\temp"));
 }