protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.ConfigureHostConfiguration(TestDefaultConfiguration.ConfigureHostConfiguration);
     builder.AddSiloBuilderConfigurator <SiloInvokerTestSiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <ClientConfigurator>();
     builder.ConfigureLegacyConfiguration(legacy =>
     {
         legacy.ClusterConfiguration.AddMemoryStorageProvider("Default");
         legacy.ClusterConfiguration.AddMemoryStorageProvider("PubSubStore");
     });
     builder.AddClientBuilderConfigurator <ClientConfiguretor>();
     builder.AddSiloBuilderConfigurator <SiloConfigurator>();
 }
Example #2
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.Options.InitialSilosCount = 5;
     builder.AddSiloBuilderConfigurator <TestFixture.SiloBuilderConfigurator>();
     builder.AddSiloBuilderConfigurator <TransactionRecoveryTestsRunner.SiloBuilderConfiguratorUsingAzureClustering>();
     builder.AddClientBuilderConfigurator <TransactionRecoveryTestsRunner.ClientBuilderConfiguratorUsingAzureClustering>();
 }
Example #3
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.Options.ConnectionTransport = ConnectionTransportType.TcpSocket;
     builder.Options.InitialSilosCount   = 1;
     builder.AddSiloBuilderConfigurator <SiloConfigurator>();
     builder.AddClientBuilderConfigurator <ClientConfigurator>();
 }
Example #4
0
        protected override void ConfigureTestCluster(TestClusterBuilder builder)
        {
            if (!AWSTestConstants.IsSqsAvailable)
            {
                throw new SkipException("Empty connection string");
            }

            builder.ConfigureLegacyConfiguration(options =>
            {
                //from the config files
                options.ClusterConfiguration.AddMemoryStorageProvider("MemoryStore", numStorageGrains: 1);

                //previous silo creation
                options.ClusterConfiguration.Globals.DataConnectionString = AWSTestConstants.DefaultSQSConnectionString;
                options.ClientConfiguration.DataConnectionString          = AWSTestConstants.DefaultSQSConnectionString;

                var storageConnectionString = new Dictionary <string, string>
                {
                    { "DataConnectionString", $"Service={AWSTestConstants.Service}" },
                    { "DeleteStateOnClear", "true" }
                };
            });
            builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
            builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
        }
        public ClusterFixture()
        {
            var builder = new TestClusterBuilder(1);

            builder.Options.ServiceId = "Service";
            builder.Options.ClusterId = "TestCluster";
            builder.AddSiloBuilderConfigurator <SiloConfigurator>();
            builder.AddClientBuilderConfigurator <ClientConfigurator>();

            var redisHost             = Environment.GetEnvironmentVariable("REDIS_HOST") ?? "localhost";
            var redisPort             = Environment.GetEnvironmentVariable("REDIS_PORT") ?? "6379";
            var redisConnectionString = $"{redisHost}:{redisPort}, allowAdmin=true";

            builder.ConfigureHostConfiguration(config =>
            {
                config.AddInMemoryCollection(new Dictionary <string, string>()
                {
                    { "RedisConnectionString", redisConnectionString }
                });
            });

            Cluster = builder.Build();

            Cluster.Deploy();
            Cluster.InitializeClient();
            Client = Cluster.Client;

            var redisOptions = ConfigurationOptions.Parse(redisConnectionString);

            _redis        = ConnectionMultiplexer.ConnectAsync(redisOptions).Result;
            this.Database = _redis.GetDatabase();
        }
            protected override void ConfigureTestCluster(TestClusterBuilder builder)
            {
                builder.Options.InitialSilosCount        = 4;
                builder.Options.UseTestClusterMembership = false;
                var relationalStorage = RelationalStorageForTesting.SetupInstance(AdoInvariant, TestDatabaseName).Result;

                builder.ConfigureHostConfiguration(configBuilder => configBuilder.AddInMemoryCollection(
                                                       new Dictionary <string, string>
                {
                    { ConnectionStringKey, relationalStorage.CurrentConnectionString }
                }));
                builder.ConfigureLegacyConfiguration(legacy =>
                {
                    legacy.ClusterConfiguration.Globals.ServiceId = ServiceId;

                    legacy.ClusterConfiguration.Globals.MaxResendCount = 0;

                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.MockStorageProvider>("test1");
                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.MockStorageProvider>("test2",
                                                                                                                             new Dictionary <string, string> {
                        { "Config1", "1" }, { "Config2", "2" }
                    });
                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.ErrorInjectionStorageProvider>("ErrorInjector");
                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.MockStorageProvider>("lowercase");
                });
                builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
                builder.AddClientBuilderConfigurator <GatewayConnectionTests.ClientBuilderConfigurator>();
            }
            protected override void ConfigureTestCluster(TestClusterBuilder builder)
            {
                builder.Options.InitialSilosCount        = 4;
                builder.Options.UseTestClusterMembership = false;
                builder.ConfigureLegacyConfiguration(legacy =>
                {
                    legacy.ClusterConfiguration.Globals.DataConnectionString = TestDefaultConfiguration.DataConnectionString;

                    legacy.ClusterConfiguration.Globals.ServiceId      = ServiceId;
                    legacy.ClusterConfiguration.Globals.MaxResendCount = 0;

                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.MockStorageProvider>("test1");
                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.MockStorageProvider>("test2",
                                                                                                                             new Dictionary <string, string> {
                        { "Config1", "1" }, { "Config2", "2" }
                    });
                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.ErrorInjectionStorageProvider>("ErrorInjector");
                    legacy.ClusterConfiguration.Globals.RegisterStorageProvider <UnitTests.StorageTests.MockStorageProvider>("lowercase");

                    legacy.ClusterConfiguration.AddMemoryStorageProvider("MemoryStore");
                    legacy.ClusterConfiguration.AddAzureBlobStorageProvider("AzureStore", legacy.ClusterConfiguration.Globals.DataConnectionString);
                    legacy.ClusterConfiguration.AddAzureBlobStorageProvider("AzureStore1", legacy.ClusterConfiguration.Globals.DataConnectionString);
                    legacy.ClusterConfiguration.AddAzureBlobStorageProvider("AzureStore2", legacy.ClusterConfiguration.Globals.DataConnectionString);
                    legacy.ClusterConfiguration.AddAzureBlobStorageProvider("AzureStore3", legacy.ClusterConfiguration.Globals.DataConnectionString);
                });
                builder.AddSiloBuilderConfigurator <SiloBuilderConfigurator>();
                builder.AddClientBuilderConfigurator <ClientBuilderConfigurator>();
            }
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.Options.UseTestClusterMembership = false;
     builder.Options.InitialSilosCount        = 1;
     builder.AddSiloBuilderConfigurator <SiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <ClientBuilderConfigurator>();
 }
Example #9
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.Options.InitialSilosCount = siloCount;
     builder.AddSiloBuilderConfigurator <SiloBuilderConfigurator>();
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
Example #10
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     TestUtils.CheckForAzureStorage();
     builder.CreateSiloAsync = StandaloneSiloHandle.CreateForAssembly(typeof(StreamLifecycleTests).Assembly);
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
        public ClusterFixture()
        {
            _redis = new RedisInside.Redis();
            Console.WriteLine(_redis.Endpoint.ToString());

            Console.WriteLine("Initializing Orleans TestCluster");
            var builder = new TestClusterBuilder(1);

            builder.Options.ServiceId = "Service";
            builder.Options.ClusterId = "TestCluster";
            builder.AddSiloBuilderConfigurator <SiloConfigurator>();
            builder.AddClientBuilderConfigurator <ClientConfigurator>();

            //this is one of the only ways to be able to pass data (the redis connection string) to the silo(s) that TestCluster will startup
            builder.ConfigureHostConfiguration(config =>
            {
                config.AddInMemoryCollection(new Dictionary <string, string>()
                {
                    { nameof(RedisInside.Redis), _redis.Endpoint.ToString() }
                });
            });

            Cluster = builder.Build();

            Cluster.Deploy();
            Cluster.InitializeClient();
            Client = Cluster.Client;

            var redisOptions = ConfigurationOptions.Parse(_redis.Endpoint.ToString());
            var connection   = ConnectionMultiplexer.ConnectAsync(redisOptions).Result;

            Database = connection.GetDatabase();
            Console.WriteLine("Initialized Orleans TestCluster");
        }
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.Options.InitialSilosCount = 4;
     builder.AddSiloBuilderConfigurator <TestFixture.SiloBuilderConfigurator>();
     builder.AddSiloBuilderConfigurator <SiloBuilderConfiguratorUsingAzureClustering>();
     builder.AddClientBuilderConfigurator <ClientBuilderConfiguratorUsingAzureClustering>();
 }
        private async Task DeactivateOnIdle_NonExistentActivation_Runner(int forwardCount)
        {
            var builder = new TestClusterBuilder(2);

            builder.AddClientBuilderConfigurator <ClientConfigurator>();
            builder.AddSiloBuilderConfigurator <SiloConfigurator>();
            builder.Properties["MaxForwardCount"] = forwardCount.ToString();
            Initialize(builder);

            ICollectionTestGrain grain = await PickGrainInNonPrimary();

            output.WriteLine("About to make a 1st GetAge() call.");
            TimeSpan age = await grain.GetAge();

            output.WriteLine(age.ToString());

            await grain.DeactivateSelf();

            await Task.Delay(3000);

            var thrownException = await Record.ExceptionAsync(() => grain.GetAge());

            Assert.Null(thrownException);
            output.WriteLine("\nThe 1st call after DeactivateSelf has NOT thrown any exception as expected, since forwardCount is {0}.\n", forwardCount);
        }
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     TestUtils.CheckForAzureStorage();
     builder.CreateSilo = AppDomainSiloHandle.Create;
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
Example #15
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.Options.UseInMemoryTransport = false;
     builder.Options.InitialSilosCount    = 1;
     builder.AddSiloBuilderConfigurator <SiloConfigurator>();
     builder.AddClientBuilderConfigurator <ClientConfigurator>();
 }
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     TestUtils.CheckForAzureStorage();
     builder.Options.UseTestClusterMembership = false;
     builder.AddSiloBuilderConfigurator <Configurator>();
     builder.AddClientBuilderConfigurator <Configurator>();
 }
Example #17
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     // poor fault injection requires grain instances stay on same host, so only single host for this test
     builder.Options.InitialSilosCount = 1;
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
Example #18
0
        protected override void ConfigureTestCluster(TestClusterBuilder builder)
        {
            TestUtils.CheckForAzureStorage();

            this.numExpectedSilos                    = 2;
            builder.Options.InitialSilosCount        = (short)this.numExpectedSilos;
            builder.Options.UseTestClusterMembership = false;
            builder.ConfigureLegacyConfiguration(legacy =>
            {
                legacy.ClusterConfiguration.AddMemoryStorageProvider("MemoryStore", numStorageGrains: 1);

                legacy.ClusterConfiguration.AddAzureTableStorageProvider("AzureStore", deleteOnClear: true);
                legacy.ClusterConfiguration.AddAzureTableStorageProvider("PubSubStore", deleteOnClear: true, useJsonFormat: false);

                legacy.ClusterConfiguration.AddSimpleMessageStreamProvider(SMS_STREAM_PROVIDER_NAME, fireAndForgetDelivery: false);

                legacy.ClusterConfiguration.AddAzureQueueStreamProvider(AZURE_QUEUE_STREAM_PROVIDER_NAME);
                legacy.ClusterConfiguration.AddAzureQueueStreamProvider("AzureQueueProvider2");

                legacy.ClientConfiguration.AddSimpleMessageStreamProvider(SMS_STREAM_PROVIDER_NAME, fireAndForgetDelivery: false);
                legacy.ClientConfiguration.AddAzureQueueStreamProvider(AZURE_QUEUE_STREAM_PROVIDER_NAME);
            });

            builder.AddSiloBuilderConfigurator <SiloBuilderConfigurator>();
            builder.AddClientBuilderConfigurator <ClientBuilderConfigurator>();
        }
Example #19
0
        public TestCluster CreateTestCluster()
        {
            var builder = new TestClusterBuilder();

            builder.AddClientBuilderConfigurator <TestClientBuilderConfigurator>();
            builder.AddSiloBuilderConfigurator <TestSiloBuilderConfigurator>();
            return(builder.Build());
        }
Example #20
0
        public TestClusterFixture()
        {
            var builder = new TestClusterBuilder();

            builder.AddClientBuilderConfigurator <TestClientBuilderConfigurator>();
            Cluster = builder.Build();
            Cluster.Deploy();
        }
Example #21
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.ConfigureLegacyConfiguration(legacy =>
     {
         AdjustConfig(legacy.ClusterConfiguration);
     });
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
Example #22
0
 protected void Initialize <TClientConfig, TSiloConfig>(short noOfSilos)
     where TSiloConfig : ISiloBuilderConfigurator, new()
     where TClientConfig : IClientBuilderConfigurator, new()
 {
     _noOfSilos = noOfSilos;
     _builder   = new TestClusterBuilder(_noOfSilos);
     _builder.AddSiloBuilderConfigurator <TSiloConfig>();
     _builder.AddClientBuilderConfigurator <TClientConfig>();
 }
        public static TestCluster BuildTestCluster()
        {
            var builder = new TestClusterBuilder(3);

            builder.Options.ServiceId = Guid.NewGuid().ToString();
            builder.AddSiloBuilderConfigurator <SampleSiloBuilderConfigurator>();
            builder.AddClientBuilderConfigurator <SampleClientBuilderConfigurator>();
            return(builder.Build());
        }
Example #24
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     if (!AWSTestConstants.IsSqsAvailable)
     {
         throw new SkipException("Empty connection string");
     }
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
        public ClusterFixture()
        {
            var builder = new TestClusterBuilder(1);

            builder.AddSiloBuilderConfigurator <SiloConfigurations>();
            builder.AddClientBuilderConfigurator <ClientConfigurations>();

            Cluster = builder.Build();
        }
Example #26
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     if (!isDynamoDbAvailable.Value)
     {
         throw new SkipException("Unable to connect to DynamoDB simulator");
     }
     builder.AddSiloBuilderConfigurator <SiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <ClientBuilderConfigurator>();
 }
        private void CreateAndDeployTestCluster()
        {
            var builder = new TestClusterBuilder(3);

            builder.AddSiloBuilderConfigurator <SiloConfigurator>();
            builder.AddClientBuilderConfigurator <ClientConfigurator>();
            this.hostedCluster = builder.Build();
            this.hostedCluster.Deploy();
        }
Example #28
0
        protected override void ConfigureTestCluster(TestClusterBuilder builder)
        {
            if (!GoogleTestUtils.IsPubSubSimulatorAvailable.Value)
            {
                throw new SkipException("Google PubSub Simulator not available");
            }

            builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
            builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
        }
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     builder.ConfigureLegacyConfiguration(legacy =>
     {
         // register stream provider
         legacy.ClusterConfiguration.AddMemoryStorageProvider("PubSubStore");
     });
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }
Example #30
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     TestUtils.CheckForAzureStorage();
     builder.ConfigureLegacyConfiguration(legacy =>
     {
         legacy.ClusterConfiguration.AddMemoryStorageProvider("PubSubStore");
     });
     builder.AddSiloBuilderConfigurator <MySiloBuilderConfigurator>();
     builder.AddClientBuilderConfigurator <MyClientBuilderConfigurator>();
 }