public void MsgQueueEngineSettings_Load() { try { MsgQueueEngineSettings settings; Config.SetConfig(@" §ion Engine QueueMap[0] = logical://test1 QueueMap[1] = logical://test2 FlushInterval = 1s DeadLetterTTL = 2s MaxDeliveryAttempts = 3 KeepAliveInterval = 4s SessionTimeout = 5s BkTaskInterval = 6s &endsection ".Replace('&', '#')); settings = MsgQueueEngineSettings.LoadConfig("Engine"); CollectionAssert.AreEqual(new MsgEP[] { MsgEP.Parse("logical://test1"), MsgEP.Parse("logical://test2") }, settings.QueueMap); Assert.AreEqual(TimeSpan.FromSeconds(1), settings.FlushInterval); Assert.AreEqual(TimeSpan.FromSeconds(2), settings.DeadLetterTTL); Assert.AreEqual(3, settings.MaxDeliveryAttempts); Assert.AreEqual(TimeSpan.FromSeconds(4), settings.KeepAliveInterval); Assert.AreEqual(TimeSpan.FromSeconds(5), settings.SessionTimeout); Assert.AreEqual(TimeSpan.FromSeconds(6), settings.BkTaskInterval); } finally { Config.SetConfig(null); } }
public void MsgQueueEngineSettings_Default() { MsgQueueEngineSettings settings = new MsgQueueEngineSettings(); CollectionAssert.AreEqual(new MsgEP[] { MsgEP.Parse(MsgQueue.AbstractBaseEP) }, settings.QueueMap); Assert.AreEqual(TimeSpan.FromMinutes(5), settings.FlushInterval); Assert.AreEqual(TimeSpan.FromDays(7), settings.DeadLetterTTL); Assert.AreEqual(3, settings.MaxDeliveryAttempts); Assert.AreEqual(TimeSpan.FromSeconds(30), settings.KeepAliveInterval); Assert.AreEqual(TimeSpan.FromSeconds(95), settings.SessionTimeout); Assert.AreEqual(TimeSpan.FromSeconds(1), settings.BkTaskInterval); }