Ejemplo n.º 1
0
        public void MsgQueueSettingsLoad()
        {
            try
            {
                MsgQueueSettings settings;

                Config.SetConfig(@"
&section Queue

    BaseEP         = logical://Test
    Timeout        = 1s
    MessageTTL     = 2s
    Compress       = None
    BkTaskInterval = 3s

&endsection
".Replace('&', '#'));

                settings = MsgQueueSettings.LoadConfig("Queue");
                Assert.AreEqual((MsgEP)"logical://Test", settings.BaseEP);
                Assert.AreEqual(TimeSpan.FromSeconds(1), settings.Timeout);
                Assert.AreEqual(TimeSpan.FromSeconds(2), settings.MessageTTL);
                Assert.AreEqual(Compress.None, settings.Compress);
            }
            finally
            {
                Config.SetConfig(null);
            }
        }
Ejemplo n.º 2
0
        public void MsgQueueSettingsDefault()
        {
            MsgQueueSettings settings = new MsgQueueSettings();

            Assert.AreEqual((MsgEP)MsgQueue.AbstractBaseEP, settings.BaseEP);
            Assert.AreEqual(TimeSpan.MaxValue, settings.Timeout);
            Assert.AreEqual(TimeSpan.Zero, settings.MessageTTL);
            Assert.AreEqual(Compress.Best, settings.Compress);
        }
Ejemplo n.º 3
0
        public void MsgQueueSettingsLoad_Defaults()
        {
            try
            {
                MsgQueueSettings settings;

                Config.SetConfig(null);

                settings = MsgQueueSettings.LoadConfig("Queue");
                Assert.AreEqual((MsgEP)MsgQueue.AbstractBaseEP, settings.BaseEP);
                Assert.AreEqual(TimeSpan.MaxValue, settings.Timeout);
                Assert.AreEqual(TimeSpan.Zero, settings.MessageTTL);
                Assert.AreEqual(Compress.Best, settings.Compress);
            }
            finally
            {
                Config.SetConfig(null);
            }
        }