Exemple #1
0
        public void RaiseAmbientIgnoreMessageTest()
        {
            bool handlerCalled = false;
            var  data          = new AmbientSettings.AmbientData();

            data.ConnectionRetryMessageHandler = (a) => handlerCalled = true;
            AmbientSettings._defaultSettings   = data;
            RetryPolicyUtils.RaiseAmbientIgnoreMessage(new RetryStateEx()
            {
                LastError = new Exception()
            }, 100);
            Assert.True(handlerCalled);
        }
Exemple #2
0
        public void AmbientSettingsPopulateTest()
        {
            var data = new AmbientSettings.AmbientData();

            var masterReferenceFilePath = data.MasterReferenceFilePath;

            data.MasterReferenceFilePath = masterReferenceFilePath;
            var lockTimeoutMilliSeconds = data.LockTimeoutMilliSeconds;

            data.LockTimeoutMilliSeconds = lockTimeoutMilliSeconds;
            var queryTimeoutSeconds = data.QueryTimeoutSeconds;

            data.QueryTimeoutSeconds = queryTimeoutSeconds;
            var longRunningQueryTimeoutSeconds = data.LongRunningQueryTimeoutSeconds;

            data.LongRunningQueryTimeoutSeconds = longRunningQueryTimeoutSeconds;
            var alwaysRetryOnTransientFailure = data.AlwaysRetryOnTransientFailure;

            data.AlwaysRetryOnTransientFailure = alwaysRetryOnTransientFailure;
            var connectionRetryMessageHandler = data.ConnectionRetryMessageHandler;

            data.ConnectionRetryMessageHandler = connectionRetryMessageHandler;
            var traceRowCountFailure = data.TraceRowCountFailure;

            data.TraceRowCountFailure = traceRowCountFailure;
            var tableProgressUpdateInterval = data.TableProgressUpdateInterval;

            data.TableProgressUpdateInterval = tableProgressUpdateInterval;
            var useOfflineDataReader = data.UseOfflineDataReader;

            data.UseOfflineDataReader = useOfflineDataReader;
            var streamBackingStoreForOfflineDataReading = data.StreamBackingStoreForOfflineDataReading;

            data.StreamBackingStoreForOfflineDataReading = streamBackingStoreForOfflineDataReading;
            var disableIndexesForDataPhase = data.DisableIndexesForDataPhase;

            data.DisableIndexesForDataPhase = disableIndexesForDataPhase;
            var reliableDdlEnabled = data.ReliableDdlEnabled;

            data.ReliableDdlEnabled = reliableDdlEnabled;
            var importModelDatabase = data.ImportModelDatabase;

            data.ImportModelDatabase = importModelDatabase;
            var supportAlwaysEncrypted = data.SupportAlwaysEncrypted;

            data.SupportAlwaysEncrypted = supportAlwaysEncrypted;
            var alwaysEncryptedWizardMigration = data.AlwaysEncryptedWizardMigration;

            data.AlwaysEncryptedWizardMigration = alwaysEncryptedWizardMigration;
            var skipObjectTypeBlocking = data.SkipObjectTypeBlocking;

            data.SkipObjectTypeBlocking = skipObjectTypeBlocking;
            var doNotSerializeQueryStoreSettings = data.DoNotSerializeQueryStoreSettings;

            data.DoNotSerializeQueryStoreSettings = doNotSerializeQueryStoreSettings;

            Dictionary <string, object> settings = new Dictionary <string, object>();

            settings.Add("LockTimeoutMilliSeconds", 10000);
            data.PopulateSettings(settings);
            settings["LockTimeoutMilliSeconds"] = 15000;
            data.PopulateSettings(settings);
            data.TraceSettings();
        }