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


C# TestingHost.TestingSiloOptions类代码示例

本文整理汇总了C#中Orleans.TestingHost.TestingSiloOptions的典型用法代码示例。如果您正苦于以下问题:C# TestingSiloOptions类的具体用法?C# TestingSiloOptions怎么用?C# TestingSiloOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TestingSiloOptions类属于Orleans.TestingHost命名空间,在下文中一共展示了TestingSiloOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        protected void Init(int mode = 1)
        {
            SiloHostConfig = new TestingSiloOptions
            {
                StartPrimary = true,
                ParallelStart = false,
                PickNewDeploymentId = true,
                StartFreshOrleans = true,
                StartSecondary = false,
                SiloConfigFile = new FileInfo("OrleansConfigurationForTesting.xml"),
                LivenessType = Orleans.Runtime.Configuration.GlobalConfiguration.LivenessProviderType.MembershipTableGrain,
                StartClient = true
            };

            var clientOptions = new TestingClientOptions
            {
                ProxiedGateway = true,
                Gateways = new List<IPEndPoint>(new[]
                    {
                        new IPEndPoint(IPAddress.Loopback, TestingSiloHost.ProxyBasePort),
                    }),
                PreferedGatewayIndex = 0
            };
            ClusterConfig = new ClusterConfiguration();
            ClusterConfig.LoadFromFile(new FileInfo("OrleansConfigurationForConsulTesting.xml").FullName);
            ClusterConfig.Globals.DataConnectionString = $"host=localhost;datacenter=dc1;mode={mode}";
            ClusterConfig.Globals.DataConnectionStringForReminders = $"host=localhost;datacenter=dc1;mode={mode}";
            SiloHost = new MyTestingHost(SiloHostConfig, clientOptions);
            ConsulMembershipTable = new ConsulSystemStoreProvider();
        }
开发者ID:kowalot,项目名称:Pk.OrleansUtils,代码行数:30,代码来源:ConsulMembershipTestsBase.cs

示例2: MyTestingHost

        public MyTestingHost(TestingSiloOptions siloOptions, TestingClientOptions clientOptions) :
            base(siloOptions, clientOptions)
        {
            this.siloOptions = siloOptions;
            this.clientOptions = clientOptions;


        }
开发者ID:kowalot,项目名称:Pk.OrleansUtils,代码行数:8,代码来源:MyTestingHost.cs

示例3: CreateSiloHost

        public override TestingSiloHost CreateSiloHost()
        {
            var siloOptions = new TestingSiloOptions
            {
                StartFreshOrleans = true,
                StartSecondary = false,
                SiloConfigFile = new FileInfo("OrleansConfigurationForStreamingDeactivationUnitTests.xml"),
            };

            var clientOptions = new TestingClientOptions
            {
                ClientConfigFile = new FileInfo("ClientConfigurationForStreamTesting.xml")
            };

            return new TestingSiloHost(siloOptions, clientOptions);
        }
开发者ID:REALTOBIZ,项目名称:orleans,代码行数:16,代码来源:SMSDeactivationTests.cs

示例4: Init

        private void Init()
        {
            SiloConfig = new TestingSiloOptions
            {
                StartPrimary = true,
                ParallelStart = true,
                PickNewDeploymentId = true,
                StartFreshOrleans = true,
                StartSecondary = true,
                SiloConfigFile = new FileInfo("OrleansConfigurationForConsulTesting.xml"),
                LivenessType = Orleans.Runtime.Configuration.GlobalConfiguration.LivenessProviderType.Custom
            };

            var clientOptions = new TestingClientOptions
               {
                   ProxiedGateway = true,
                   Gateways = new List<IPEndPoint>(new[]
                    {
                        new IPEndPoint(IPAddress.Loopback, TestingSiloHost.ProxyBasePort),
                    }),
                   PreferedGatewayIndex = 0
               };
            SiloHost = new MyTestingHost(SiloConfig, clientOptions);
        }
开发者ID:kowalot,项目名称:Pk.OrleansUtils,代码行数:24,代码来源:ConsulSystemStoreTests.cs

示例5: UnitTestSiloHost

 public UnitTestSiloHost(TestingSiloOptions siloOptions)
     : base(siloOptions)
 {
 }
开发者ID:NingnaD,项目名称:orleans,代码行数:4,代码来源:UnitTestSiloHost.cs

示例6: CreateSiloHost

        public override TestingSiloHost CreateSiloHost()
        {
            TestUtils.CheckForAzureStorage();

            var siloOptions = new TestingSiloOptions
            {
                StartFreshOrleans = true,
                StartPrimary = true,
                StartSecondary = true,
                DataConnectionString = StorageTestConstants.DataConnectionString,
                LivenessType = GlobalConfiguration.LivenessProviderType.ZooKeeper,
                ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.ReminderTableGrain
            };

            return new TestingSiloHost(siloOptions);
        }
开发者ID:REALTOBIZ,项目名称:orleans,代码行数:16,代码来源:LivenessTests.cs

示例7: LivenessTestsBase

 protected LivenessTestsBase(TestingSiloOptions siloOptions)
     : base(siloOptions)
 { }
开发者ID:sbambach,项目名称:orleans,代码行数:3,代码来源:LivenessTests.cs

示例8: TestingSiloHost

 /// <summary>
 /// Start the default Primary and Secondary test silos, plus client in-process, 
 /// using the specified silo config options.
 /// </summary>
 protected TestingSiloHost(TestingSiloOptions siloOptions)
     : this(siloOptions, new TestingClientOptions())
 {
 }
开发者ID:bestwpw,项目名称:orleans,代码行数:8,代码来源:TestingSiloHost.cs

示例9: StartOrleansSilo

 private SiloHandle StartOrleansSilo(Silo.SiloType type, TestingSiloOptions options, int instanceCount, AppDomain shared = null)
 {
     return StartOrleansSilo(this, type, options, instanceCount, shared);
 }
开发者ID:bestwpw,项目名称:orleans,代码行数:4,代码来源:TestingSiloHost.cs

示例10: AdjustForTest

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

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

示例11: RedeployTestingSiloHost

 public void RedeployTestingSiloHost(TestingSiloOptions siloOptions = null, TestingClientOptions clientOptions = null)
 {
     StopAllSilos();
     DeployTestingSiloHost(siloOptions ?? new TestingSiloOptions(), clientOptions ?? new TestingClientOptions());
 }
开发者ID:bestwpw,项目名称:orleans,代码行数:5,代码来源:TestingSiloHost.cs

示例12: AdjustForTest

        /// <summary> Modify the cluster configurations to the test environment </summary>
        /// <param name="config">The cluster configuration to modify</param>
        /// <param name="options">the TestingSiloOptions to modify</param>
        public static void AdjustForTest(ClusterConfiguration config, TestingSiloOptions options)
        {
            if (options.AdjustConfig != null) {
                options.AdjustConfig(config);
            }

            config.AdjustForTestEnvironment(TestClusterOptions.FallbackOptions.DefaultExtendedConfiguration["DataConnectionString"]);
        }
开发者ID:osjimenez,项目名称:orleans,代码行数:11,代码来源:TestingSiloHost.cs

示例13: BeforeEachTest

        public void BeforeEachTest()
        {

            var siloOptions = new TestingSiloOptions
            {
                StartFreshOrleans = true,
                StartPrimary = true,
                StartSecondary = false,
                SiloConfigFile = new FileInfo("OrleansConfigurationForConsulTesting.xml"),
                LivenessType = GlobalConfiguration.LivenessProviderType.MembershipTableGrain,
                ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.ReminderTableGrain,
                DataConnectionString = $"index={remindersIndex};Host=localhost"
            };
            var clientOptions = new TestingClientOptions
            {
                ProxiedGateway = true,
                Gateways = new List<IPEndPoint>(new[]
                {
                        new IPEndPoint(IPAddress.Loopback, TestingSiloHost.ProxyBasePort),
                    }),
                PreferedGatewayIndex = 0
            };
            deleteTestIndices();
            ClusterConfig = new ClusterConfiguration();
            ClusterConfig.LoadFromFile(siloOptions.SiloConfigFile.FullName);
            TestReminderTable = new ElasticReminderTable();
            ClusterConfig.Globals.DataConnectionStringForReminders = $"index={ remindersIndex};Host=localhost";
            SiloHost = new MyTestingHost(siloOptions,clientOptions);
        }
开发者ID:kowalot,项目名称:Pk.OrleansUtils,代码行数:29,代码来源:Elastic_ReminderTableUnitTests.cs

示例14: ReminderTests_Base

 protected ReminderTests_Base(TestingSiloOptions siloOptions)
     : base(siloOptions)
 {
     log = TraceLogger.GetLogger(this.GetType().Name, TraceLogger.LoggerType.Application);
 }
开发者ID:sbambach,项目名称:orleans,代码行数:5,代码来源:ReminderTests_Base.cs

示例15: DeployTestingSiloHost

        private void DeployTestingSiloHost(TestingSiloOptions siloOptions, TestingClientOptions clientOptions)
        {
            siloInitOptions = siloOptions;
            clientInitOptions = clientOptions;

            AppDomain.CurrentDomain.UnhandledException += ReportUnobservedException;

            try
            {
                InitializeAsync(siloOptions, clientOptions).Wait();
                string startMsg = "----------------------------- STARTING NEW UNIT TEST SILO HOST: " + GetType().FullName + " -------------------------------------";
                WriteLog(startMsg);
            }
            catch (TimeoutException te)
            {
                throw new TimeoutException("Timeout during test initialization", te);
            }
            catch (Exception ex)
            {
                Exception baseExc = ex.GetBaseException();
                if (baseExc is TimeoutException)
                {
                    throw new TimeoutException("Timeout during test initialization", ex);
                }
                // IMPORTANT:
                // Do NOT re-throw the original exception here, also not as an internal exception inside AggregateException
                // Due to the way MS tests works, if the original exception is an Orleans exception,
                // it's assembly might not be loaded yet in this phase of the test.
                // As a result, we will get "MSTest: Unit Test Adapter threw exception: Type is not resolved for member XXX"
                // and will loose the oroginal exception. This makes debugging tests super hard!
                // The root cause has to do with us initializing our tests from Test constructor and not from TestInitialize method.
                // More details: http://dobrzanski.net/2010/09/20/mstest-unit-test-adapter-threw-exception-type-is-not-resolved-for-member/
                throw new Exception(
                    string.Format("Exception during test initialization: {0}",
                        TraceLogger.PrintException(baseExc)));
            }
        }
开发者ID:bestwpw,项目名称:orleans,代码行数:37,代码来源:TestingSiloHost.cs


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