本文整理汇总了C#中ClientConfiguration.AdjustForTestEnvironment方法的典型用法代码示例。如果您正苦于以下问题:C# ClientConfiguration.AdjustForTestEnvironment方法的具体用法?C# ClientConfiguration.AdjustForTestEnvironment怎么用?C# ClientConfiguration.AdjustForTestEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientConfiguration
的用法示例。
在下文中一共展示了ClientConfiguration.AdjustForTestEnvironment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildClientConfiguration
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;
}
示例2: AdjustForTest
public static void AdjustForTest(ClientConfiguration config, TestingClientOptions options)
{
if (options.AdjustConfig != null) {
options.AdjustConfig(config);
}
config.AdjustForTestEnvironment();
}
示例3: AdjustForTest
public virtual void AdjustForTest(ClientConfiguration config)
{
config.AdjustForTestEnvironment();
}
示例4: BuildClientConfiguration
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;
}
示例5: AdjustForTest
/// <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"]);
}