当前位置: 首页>>代码示例>>C#>>正文


C# ClientConfiguration.AdjustForTestEnvironment方法代码示例

本文整理汇总了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;
        }
开发者ID:MikeHardman,项目名称:orleans,代码行数:55,代码来源:TestClusterOptions.cs

示例2: AdjustForTest

        public static void AdjustForTest(ClientConfiguration config, TestingClientOptions options)
        {
            if (options.AdjustConfig != null) {
                options.AdjustConfig(config);
            }

            config.AdjustForTestEnvironment();
        }
开发者ID:bestwpw,项目名称:orleans,代码行数:8,代码来源:TestingSiloHost.cs

示例3: AdjustForTest

 public virtual void AdjustForTest(ClientConfiguration config)
 {
     config.AdjustForTestEnvironment();
 }
开发者ID:jmfaleiro,项目名称:orleans,代码行数:4,代码来源:TestingSiloHost.cs

示例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;
        }
开发者ID:PaulNorth,项目名称:orleans,代码行数:29,代码来源:TestClusterOptions.cs

示例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"]);
        }
开发者ID:osjimenez,项目名称:orleans,代码行数:11,代码来源:TestingSiloHost.cs


注:本文中的ClientConfiguration.AdjustForTestEnvironment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。