Ejemplo n.º 1
0
        public virtual void TestWithRetriableAndRetryDisabled()
        {
            Configuration conf   = new Configuration();
            RetryPolicy   policy = RetryUtils.GetDefaultRetryPolicy(conf, "Test.No.Such.Key", false
                                                                    , "Test.No.Such.Key", "10000,6", null);

            // defaultRetryPolicyEnabled = false
            RetryPolicy.RetryAction action = policy.ShouldRetry(new RetriableException("Dummy exception"
                                                                                       ), 0, 0, true);
            Assert.AssertThat(action.action, IS.Is(RetryPolicy.RetryAction.RetryDecision.Fail
                                                   ));
        }
Ejemplo n.º 2
0
        public virtual void TestWithWrappedRetriable()
        {
            Configuration conf   = new Configuration();
            RetryPolicy   policy = RetryUtils.GetDefaultRetryPolicy(conf, "Test.No.Such.Key", true
                                                                    , "Test.No.Such.Key", "10000,6", null);

            // defaultRetryPolicyEnabled = true
            RetryPolicy.RetryAction action = policy.ShouldRetry(new RemoteException(typeof(RetriableException
                                                                                           ).FullName, "Dummy exception"), 0, 0, true);
            Assert.AssertThat(action.action, IS.Is(RetryPolicy.RetryAction.RetryDecision.Retry
                                                   ));
        }