public static ClientConfiguration BuildClientConfiguration(ClusterConfiguration clusterConfig) { var config = new ClientConfiguration(); config.TraceFilePattern = clusterConfig.Defaults.TraceFilePattern; config.TraceToConsole = DefaultTraceToConsole; switch (clusterConfig.Globals.LivenessType) { case GlobalConfiguration.LivenessProviderType.AzureTable: config.GatewayProvider = ClientConfiguration.GatewayProviderType.AzureTable; break; case GlobalConfiguration.LivenessProviderType.SqlServer: config.GatewayProvider = ClientConfiguration.GatewayProviderType.SqlServer; break; case GlobalConfiguration.LivenessProviderType.ZooKeeper: config.GatewayProvider = ClientConfiguration.GatewayProviderType.ZooKeeper; break; case GlobalConfiguration.LivenessProviderType.Custom: config.GatewayProvider = ClientConfiguration.GatewayProviderType.Custom; config.CustomGatewayProviderAssemblyName = clusterConfig.Globals.MembershipTableAssembly; break; case GlobalConfiguration.LivenessProviderType.NotSpecified: case GlobalConfiguration.LivenessProviderType.MembershipTableGrain: default: config.GatewayProvider = ClientConfiguration.GatewayProviderType.Config; var primaryProxyEndpoint = clusterConfig.Overrides[Silo.PrimarySiloName].ProxyGatewayEndpoint; if (primaryProxyEndpoint != null) { config.Gateways.Add(primaryProxyEndpoint); } foreach (var nodeConfiguration in clusterConfig.Overrides.Values.Where(x => x.SiloName != Silo.PrimarySiloName && x.ProxyGatewayEndpoint != null)) { config.Gateways.Add(nodeConfiguration.ProxyGatewayEndpoint); } break; } config.DataConnectionString = clusterConfig.Globals.DataConnectionString; config.PropagateActivityId = clusterConfig.Defaults.PropagateActivityId; config.DeploymentId = clusterConfig.Globals.DeploymentId; if (Debugger.IsAttached) { // Test is running inside debugger - Make timeout ~= infinite config.ResponseTimeout = TimeSpan.FromMilliseconds(1000000); } else { config.ResponseTimeout = clusterConfig.Globals.ResponseTimeout; } config.LargeMessageWarningThreshold = clusterConfig.Defaults.LargeMessageWarningThreshold; // TODO: copy test environment config from globals instead of from constants config.AdjustForTestEnvironment(); return(config); }
public static ClientConfiguration BuildClientConfiguration(ClusterConfiguration clusterConfig) { var config = new ClientConfiguration { GatewayProvider = ClientConfiguration.GatewayProviderType.Config }; config.TraceFilePattern = clusterConfig.Defaults.TraceFilePattern; config.TraceToConsole = DefaultTraceToConsole; config.Gateways.Add(clusterConfig.Overrides[Silo.PrimarySiloName].ProxyGatewayEndpoint); foreach (var nodeConfiguration in clusterConfig.Overrides.Values.Where(x => x.SiloName != Silo.PrimarySiloName)) { config.Gateways.Add(nodeConfiguration.ProxyGatewayEndpoint); } config.PropagateActivityId = clusterConfig.Defaults.PropagateActivityId; config.DeploymentId = clusterConfig.Globals.DeploymentId; if (Debugger.IsAttached) { // Test is running inside debugger - Make timeout ~= infinite config.ResponseTimeout = TimeSpan.FromMilliseconds(1000000); } else { config.ResponseTimeout = clusterConfig.Globals.ResponseTimeout; } config.LargeMessageWarningThreshold = clusterConfig.Defaults.LargeMessageWarningThreshold; // TODO: copy test environment config from globals instead of from constants config.AdjustForTestEnvironment(); return(config); }
public void AdjustForTest(ClientConfiguration config, TestingClientOptions options) { if (options.AdjustConfig != null) { options.AdjustConfig(config); } config.AdjustForTestEnvironment(); }
/// <summary> Modify the ClientConfiguration to the test environment </summary> /// <param name="config">The client configuration to modify</param> /// <param name="options">the TestingClientOptions to modify</param> public static void AdjustForTest(ClientConfiguration config, TestingClientOptions options) { if (options.AdjustConfig != null) { options.AdjustConfig(config); } config.AdjustForTestEnvironment(TestClusterOptions.FallbackOptions.DefaultExtendedConfiguration["DataConnectionString"]); }
/// <summary> /// Build the client configuration based on the cluster configuration. If a debugger is attached, /// the response timeout will be overridden to 1000000ms /// </summary> /// <param name="clusterConfig">The reference cluster configuration.</param> /// <returns>THe builded client configuration</returns> public static ClientConfiguration BuildClientConfiguration(ClusterConfiguration clusterConfig) { var config = new ClientConfiguration(); config.TraceFilePattern = clusterConfig.Defaults.TraceFilePattern; switch (clusterConfig.Globals.LivenessType) { case GlobalConfiguration.LivenessProviderType.AzureTable: config.GatewayProvider = ClientConfiguration.GatewayProviderType.AzureTable; break; case GlobalConfiguration.LivenessProviderType.SqlServer: config.GatewayProvider = ClientConfiguration.GatewayProviderType.SqlServer; break; case GlobalConfiguration.LivenessProviderType.ZooKeeper: config.GatewayProvider = ClientConfiguration.GatewayProviderType.ZooKeeper; break; case GlobalConfiguration.LivenessProviderType.Custom: config.GatewayProvider = ClientConfiguration.GatewayProviderType.Custom; config.CustomGatewayProviderAssemblyName = clusterConfig.Globals.MembershipTableAssembly; break; case GlobalConfiguration.LivenessProviderType.NotSpecified: case GlobalConfiguration.LivenessProviderType.MembershipTableGrain: default: config.GatewayProvider = ClientConfiguration.GatewayProviderType.Config; var primaryProxyEndpoint = clusterConfig.Overrides[Silo.PrimarySiloName].ProxyGatewayEndpoint; if (primaryProxyEndpoint != null) { config.Gateways.Add(primaryProxyEndpoint); } foreach (var nodeConfiguration in clusterConfig.Overrides.Values.Where(x => x.SiloName != Silo.PrimarySiloName && x.ProxyGatewayEndpoint != null)) { config.Gateways.Add(nodeConfiguration.ProxyGatewayEndpoint); } break; } config.DataConnectionString = clusterConfig.Globals.DataConnectionString; config.AdoInvariant = clusterConfig.Globals.AdoInvariant; config.DeploymentId = clusterConfig.Globals.DeploymentId; config.PropagateActivityId = clusterConfig.Defaults.PropagateActivityId; // If a debugger is attached, override the timeout setting config.ResponseTimeout = Debugger.IsAttached ? TimeSpan.FromMilliseconds(1000000) : clusterConfig.Globals.ResponseTimeout; config.AdjustForTestEnvironment(clusterConfig.Globals.DataConnectionString); return(config); }
public static ClientConfiguration BuildClientConfiguration(ClusterConfiguration clusterConfig) { var config = new ClientConfiguration(); config.TraceFilePattern = clusterConfig.Defaults.TraceFilePattern; config.TraceToConsole = DefaultTraceToConsole; switch (clusterConfig.Globals.LivenessType) { case GlobalConfiguration.LivenessProviderType.AzureTable: config.GatewayProvider = ClientConfiguration.GatewayProviderType.AzureTable; break; case GlobalConfiguration.LivenessProviderType.SqlServer: config.GatewayProvider = ClientConfiguration.GatewayProviderType.SqlServer; break; case GlobalConfiguration.LivenessProviderType.ZooKeeper: config.GatewayProvider = ClientConfiguration.GatewayProviderType.ZooKeeper; break; case GlobalConfiguration.LivenessProviderType.Custom: config.GatewayProvider = ClientConfiguration.GatewayProviderType.Custom; config.CustomGatewayProviderAssemblyName = clusterConfig.Globals.MembershipTableAssembly; break; case GlobalConfiguration.LivenessProviderType.NotSpecified: case GlobalConfiguration.LivenessProviderType.MembershipTableGrain: default: config.GatewayProvider = ClientConfiguration.GatewayProviderType.Config; var primaryProxyEndpoint = clusterConfig.Overrides[Silo.PrimarySiloName].ProxyGatewayEndpoint; if (primaryProxyEndpoint != null) { config.Gateways.Add(primaryProxyEndpoint); } foreach (var nodeConfiguration in clusterConfig.Overrides.Values.Where(x => x.SiloName != Silo.PrimarySiloName && x.ProxyGatewayEndpoint != null)) { config.Gateways.Add(nodeConfiguration.ProxyGatewayEndpoint); } break; } config.DataConnectionString = clusterConfig.Globals.DataConnectionString; config.PropagateActivityId = clusterConfig.Defaults.PropagateActivityId; config.DeploymentId = clusterConfig.Globals.DeploymentId; if (Debugger.IsAttached) { // Test is running inside debugger - Make timeout ~= infinite config.ResponseTimeout = TimeSpan.FromMilliseconds(1000000); } else { config.ResponseTimeout = clusterConfig.Globals.ResponseTimeout; } config.LargeMessageWarningThreshold = clusterConfig.Defaults.LargeMessageWarningThreshold; // TODO: copy test environment config from globals instead of from constants config.AdjustForTestEnvironment(); return config; }
public static void AdjustForTest(ClientConfiguration config, TestingClientOptions options) { if (options.AdjustConfig != null) { options.AdjustConfig(config); } config.AdjustForTestEnvironment(); }
public virtual void AdjustForTest(ClientConfiguration config) { config.AdjustForTestEnvironment(); }
public static ClientConfiguration BuildClientConfiguration(ClusterConfiguration clusterConfig) { var config = new ClientConfiguration { GatewayProvider = ClientConfiguration.GatewayProviderType.Config }; config.TraceFilePattern = clusterConfig.Defaults.TraceFilePattern; config.TraceToConsole = DefaultTraceToConsole; config.Gateways.Add(clusterConfig.Overrides[Silo.PrimarySiloName].ProxyGatewayEndpoint); foreach (var nodeConfiguration in clusterConfig.Overrides.Values.Where(x => x.SiloName != Silo.PrimarySiloName)) { config.Gateways.Add(nodeConfiguration.ProxyGatewayEndpoint); } config.PropagateActivityId = clusterConfig.Defaults.PropagateActivityId; config.DeploymentId = clusterConfig.Globals.DeploymentId; if (Debugger.IsAttached) { // Test is running inside debugger - Make timeout ~= infinite config.ResponseTimeout = TimeSpan.FromMilliseconds(1000000); } else { config.ResponseTimeout = clusterConfig.Globals.ResponseTimeout; } config.LargeMessageWarningThreshold = clusterConfig.Defaults.LargeMessageWarningThreshold; // TODO: copy test environment config from globals instead of from constants config.AdjustForTestEnvironment(); return config; }
public virtual void AdjustForTest(ClientConfiguration config) { config.AdjustForTestEnvironment(); }
/// <summary> Modify the ClientConfiguration to the test environment </summary> /// <param name="config">The client configuration to modify</param> /// <param name="options">the TestingClientOptions to modify</param> public static void AdjustForTest(ClientConfiguration config, TestingClientOptions options) { if (options.AdjustConfig != null) { options.AdjustConfig(config); } config.AdjustForTestEnvironment(TestClusterOptions.FallbackOptions.DefaultExtendedConfiguration["DataConnectionString"]); }