예제 #1
0
 public void ConfigCommand_Key_Group_Domain_MaxConcurrentCount()
 {
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey, TestGroupKey, TestDomain, CustomConfigSet.CommandMaxConcurrentCount);
     Assert.AreEqual(TestGroupKey, CommandComponents.CommandInfo.GroupKey, true);
     Assert.AreEqual(TestDomain, CommandComponents.CommandInfo.Domain, true);
     Assert.AreEqual(CustomConfigSet.CommandMaxConcurrentCount, CommandComponents.ConfigSet.CommandMaxConcurrentCount);
 }
예제 #2
0
 public void ConfigAllCommandSettings()
 {
     Assert.IsFalse(ScenarioTestHelper.AreEqual(DefaultConfigSet, CustomConfigSet));
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey,
                                               configSet => ScenarioTestHelper.SetCommandConfigFrom(configSet, CustomConfigSet));
     Assert.IsTrue(ScenarioTestHelper.AreEqual(CustomConfigSet, CommandComponents.ConfigSet));
 }
예제 #3
0
 public void ConfigCommand_Key_Domain_Config()
 {
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey, TestDomain,
                                               config => ScenarioTestHelper.SetCommandConfigFrom(config, CustomConfigSet));
     Assert.AreEqual(TestDomain, CommandComponents.CommandInfo.Domain, true);
     Assert.IsTrue(ScenarioTestHelper.AreEqual(CustomConfigSet, CommandComponents.ConfigSet));
 }
예제 #4
0
 public void ConfigCommandWithDefaultConfig()
 {
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey, config => {});
     Assert.AreEqual(TestCommandKey, CommandComponents.CommandInfo.Key, true);
     Assert.AreEqual(HystrixCommandBase.DefaultGroupKey, CommandComponents.CommandInfo.GroupKey, true);
     Assert.AreEqual(CommandDomains.Default, CommandComponents.CommandInfo.Domain, true);
     Assert.IsTrue(ScenarioTestHelper.AreEqual(DefaultConfigSet, CommandComponents.ConfigSet));
 }
예제 #5
0
 public void ConfigCommand_Key_Group_Domain_MaxConcurrentCount_Timeout_RequestCountThreshold_ErrorThresholdPercentage_FallbackMaxConcurrentCount()
 {
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey, TestGroupKey, TestDomain,
                                               CustomConfigSet.CommandMaxConcurrentCount, CustomConfigSet.CommandTimeoutInMilliseconds,
                                               CustomConfigSet.CircuitBreakerRequestCountThreshold, CustomConfigSet.CircuitBreakerErrorThresholdPercentage,
                                               CustomConfigSet.FallbackMaxConcurrentCount);
     Assert.AreEqual(TestGroupKey, CommandComponents.CommandInfo.GroupKey, true);
     Assert.AreEqual(TestDomain, CommandComponents.CommandInfo.Domain, true);
     Assert.IsFalse(ScenarioTestHelper.AreEqual(CustomConfigSet, CommandComponents.ConfigSet));
     Assert.AreEqual(CustomConfigSet.CommandMaxConcurrentCount, CommandComponents.ConfigSet.CommandMaxConcurrentCount);
     Assert.AreEqual(CustomConfigSet.CommandTimeoutInMilliseconds, CommandComponents.ConfigSet.CommandTimeoutInMilliseconds);
     Assert.AreEqual(CustomConfigSet.CircuitBreakerRequestCountThreshold, CommandComponents.ConfigSet.CircuitBreakerRequestCountThreshold);
     Assert.AreEqual(CustomConfigSet.CircuitBreakerErrorThresholdPercentage, CommandComponents.ConfigSet.CircuitBreakerErrorThresholdPercentage);
     Assert.AreEqual(CustomConfigSet.FallbackMaxConcurrentCount, CommandComponents.ConfigSet.FallbackMaxConcurrentCount);
 }
예제 #6
0
 protected override void CustomTestInit()
 {
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey, config => { });
     CommandComponents.ConfigSet.InitTestHealthSnapshotInterval();
     CommandComponents.ConfigSet.CommandTimeoutInMilliseconds = TimeoutInMilliseconds;
 }
예제 #7
0
 public void ConfigCommand_Key_Group_Domain()
 {
     HystrixCommandBase.ConfigCommand <string>(TestCommandKey, TestGroupKey, TestDomain);
     Assert.AreEqual(TestGroupKey, CommandComponents.CommandInfo.GroupKey, true);
     Assert.AreEqual(TestDomain, CommandComponents.CommandInfo.Domain, true);
 }