protected MembershipTableTestsBase(ITestOutputHelper output, MultiplexerFixture multiplexerFixture, LoggerFilterOptions filters)
        {
            logger         = new XunitLogger <MembershipTableTestsBase>(output);
            this.clusterId = "testC-" + Guid.NewGuid();
            this.serviceId = "testS-" + Guid.NewGuid();

            this.logger?.Info("ClusterId={0}", this.clusterId);
            this.logger?.Info("ServiceId={0}", this.serviceId);

            this.clusterOptions = Options.Create(new ClusterOptions {
                ClusterId = this.clusterId, ServiceId = this.serviceId
            });

            var adoVariant = GetAdoInvariant();

            var options = new RedisOptions
            {
                ConnectionString = "localhost:6379, allowAdmin=true",
                Database         = 0
            };

            this.multiplexerFixture = multiplexerFixture;
            this.multiplexerFixture.Initialize(options);

            this.membershipTable = CreateMembershipTable(this.loggerFactory);
            this.membershipTable.InitializeMembershipTable(true).WithTimeout(TimeSpan.FromMinutes(10)).Wait();

            this.gatewayListProvider = CreateGatewayListProvider(this.membershipTable, this.loggerFactory);
            this.gatewayListProvider.InitializeGatewayListProvider().WithTimeout(TimeSpan.FromMinutes(3)).Wait();
        }
Beispiel #2
0
        protected MembershipTableTestsBase(ITestOutputHelper output, MultiplexerFixture multiplexerFixture, LoggerFilterOptions filters)
        {
            this.logger    = new XunitLogger <MembershipTableTestsBase>(output);
            this.clusterId = "testC-" + Guid.NewGuid();
            this.serviceId = "testS-" + Guid.NewGuid();

            this.logger.Info("ClusterId={0}", this.clusterId);
            this.logger.Info("ServiceId={0}", this.serviceId);

            this.clusterOptions = Options.Create(new ClusterOptions {
                ClusterId = this.clusterId, ServiceId = this.serviceId
            });

            var redisHost = Environment.GetEnvironmentVariable("REDIS_HOST") ?? "localhost";
            var redisPort = Environment.GetEnvironmentVariable("REDIS_PORT") ?? "6379";

            var options = new RedisClusteringOptions
            {
                ConnectionString = $"{redisHost}:{redisPort}, allowAdmin=true",
                Database         = 0
            };

            this.multiplexerFixture = multiplexerFixture;
            this.multiplexerFixture.Initialize(options);

            this.membershipTable = CreateMembershipTable(this.loggerFactory);
            this.membershipTable.InitializeMembershipTable(true).WithTimeout(TimeSpan.FromMinutes(10)).Wait();

            this.gatewayListProvider = CreateGatewayListProvider(this.membershipTable, this.loggerFactory);
            this.gatewayListProvider.InitializeGatewayListProvider().WithTimeout(TimeSpan.FromMinutes(3)).Wait();
        }