Пример #1
0
        public static DeploymentResult GrantMsmqPermission(this RemoteDropkickExecutionTask remoteTask, QueuePermission permission, QueueAddress address, string @group)
        {
            string perm;
            switch (permission)
            {
                case QueuePermission.Read:
                    perm = "r";
                    break;
                case QueuePermission.Write:
                    perm = "w";
                    break;
                case QueuePermission.ReadWrite:
                    perm = "rw";
                    break;
                case QueuePermission.SetSensibleDefaults:
                    perm = "default";
                    break;
                default:
                    perm = "r";
                    break;
            }

            var t = remoteTask.SetUpRemote("grant_queue \"{0}\" \"{1}\" \"{2}\"".FormatWith(perm, @group, address.ActualUri));
            return remoteTask.ExecuteAndGetResults(t);
        }
Пример #2
0
        public void Setup()
        {
            var ub = new UriBuilder("msmq", "SrvTestWeb01") {Path = "dk_test"};
            _address = new QueueAddress(ub.Uri);

            //            if (MessageQueue.Exists(_address.LocalName))
            //                MessageQueue.Delete(_address.LocalName);
            //
            //            MessageQueue.Create(_address.LocalName);
        }
Пример #3
0
        public void Setup()
        {
            var ub = new UriBuilder("msmq", Environment.MachineName) {Path = "dk_test"};
            _address = new QueueAddress(ub.Uri);

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

            MessageQueue.Create(_address.LocalName);
        }
            public override void Context()
            {
                server = new DeploymentServer("localhost");
                user = WindowsIdentity.GetCurrent().Name;

                var ub = new UriBuilder("msmq", Environment.MachineName)
                {
                    Path = "dk_test"
                };
                address = new QueueAddress(ub.Uri);
            }
Пример #5
0
        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.");
        }
Пример #6
0
        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.");
        }
            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);
            }
Пример #8
0
        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.");
        }
Пример #9
0
 public static DeploymentResult VerifyQueueExists(this RemoteDropkickExecutionTask remoteTask, QueueAddress path)
 {
     var t = remoteTask.SetUpRemote("verify_queue \"{0}\"".FormatWith(path.ActualUri));
     return remoteTask.ExecuteAndGetResults(t);
 }
Пример #10
0
 public static DeploymentResult CreateQueue(this RemoteDropkickExecutionTask remoteTask, QueueAddress path, bool transactional = false)
 {
     var t = remoteTask.SetUpRemote("create_queue \"{0}\" \"{1}\"".FormatWith(path.ActualUri, transactional));
     return remoteTask.ExecuteAndGetResults(t);
 }