Ejemplo n.º 1
0
        public void Should_be_able_to_set_parameter_values()
        {
            var parser = new MsmqUriParser(new Uri("msmq://./work-queue?transactional=false&journal=false"));

            Assert.IsFalse(parser.Transactional);
            Assert.IsFalse(parser.Journal);
        }
Ejemplo n.º 2
0
        public void Should_be_able_to_create_with_default_parameter_values()
        {
            var parser = new MsmqUriParser(new Uri("msmq://./work-queue"));

            Assert.IsTrue(parser.Transactional);
            Assert.IsTrue(parser.Journal);
        }
Ejemplo n.º 3
0
        public bool Execute(MsmqUriParser parser, TimeSpan timeout)
        {
            State.Clear();

            State.Add(parser);
            State.Add("timeout", timeout);

            return base.Execute();
        }
        public bool Execute(Guid messageId, MsmqUriParser parser, TimeSpan timeout)
        {
            State.Clear();

            State.Add("messageId", messageId);
            State.Add(parser);
            State.Add("timeout", timeout);

            return base.Execute();
        }
        public bool Execute(MsmqUriParser parser, TimeSpan timeout)
        {
            if (!parser.Journal)
            {
                return false;
            }

            State.Clear();

            State.Add(parser);
            State.Add("timeout", timeout);

            return base.Execute();
        }
Ejemplo n.º 6
0
        public MsmqQueue(Uri uri, IMsmqConfiguration configuration)
        {
            Guard.AgainstNull(uri, "uri");
            Guard.AgainstNull(configuration, "configuration");

            _log = Log.For(this);

            _parser = new MsmqUriParser(uri);

            _timeout = _parser.Local
                           ? TimeSpan.FromMilliseconds(configuration.LocalQueueTimeoutMilliseconds)
                           : TimeSpan.FromMilliseconds(configuration.RemoteQueueTimeoutMilliseconds);

            Uri = _parser.Uri;

            _messagePropertyFilter = new MessagePropertyFilter();
            _messagePropertyFilter.SetAll();

            _dequeuePipelinePool = new ReusableObjectPool<MsmqGetMessagePipeline>();
        }
Ejemplo n.º 7
0
        public void Should_be_able_to_parse_a_valid_uri()
        {
            var parser = new MsmqUriParser(new Uri("msmq://./work-queue"));

            Assert.AreEqual(string.Format("msmq://{0}/work-queue", Environment.MachineName.ToLower()), parser.Uri.ToString());
        }
Ejemplo n.º 8
0
        public void Should_be_able_to_parse_an_ip_address()
        {
            var parser = new MsmqUriParser(new Uri("msmq://127.0.0.1/work-queue"));

            Assert.AreEqual("msmq://127.0.0.1/work-queue", parser.Uri.ToString());
        }