Пример #1
0
 public DynamoDBStorageProviderTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output  = output;
     this.fixture = fixture;
     providerCfgProps["DataConnectionString"] = $"Service={AWSTestConstants.Service}";
     this.providerRuntime = new ClientProviderRuntime(fixture.InternalGrainFactory, fixture.Services, NullLoggerFactory.Instance);
 }
Пример #2
0
 public MessageSerializerTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output            = output;
     this.fixture           = fixture;
     this.messageFactory    = this.fixture.Services.GetRequiredService <MessageFactory>();
     this.messageSerializer = this.fixture.Services.GetRequiredService <IMessageSerializer>();
 }
Пример #3
0
 public AzureQueueAdapterTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output        = output;
     this.fixture       = fixture;
     this.loggerFactory = this.fixture.Services.GetService <ILoggerFactory>();
     BufferPool.InitGlobalBufferPool(new SiloMessagingOptions());
 }
Пример #4
0
        protected const string testDatabaseName = "OrleansMembershipTest";//for relational storage

        protected MembershipTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment, LoggerFilterOptions filters)
        {
            this.environment = environment;
            loggerFactory    = TestingUtils.CreateDefaultLoggerFactory(new NodeConfiguration().TraceFileName, filters);
            logger           = new LoggerWrapper <MembershipTableTestsBase>(loggerFactory);

            deploymentId = "test-" + Guid.NewGuid();

            logger.Info("DeploymentId={0}", deploymentId);

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            var globalConfiguration = new GlobalConfiguration
            {
                DeploymentId         = deploymentId,
                AdoInvariant         = GetAdoInvariant(),
                DataConnectionString = fixture.ConnectionString
            };

            membershipTable = CreateMembershipTable(logger);
            membershipTable.InitializeMembershipTable(globalConfiguration, true).WithTimeout(TimeSpan.FromMinutes(1)).Wait();

            var clientConfiguration = new ClientConfiguration
            {
                DeploymentId         = globalConfiguration.DeploymentId,
                AdoInvariant         = globalConfiguration.AdoInvariant,
                DataConnectionString = globalConfiguration.DataConnectionString
            };

            gatewayListProvider = CreateGatewayListProvider(logger);
            gatewayListProvider.InitializeGatewayListProvider(clientConfiguration).WithTimeout(TimeSpan.FromMinutes(1)).Wait();
        }
Пример #5
0
        protected MembershipTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment, LoggerFilterOptions filters)
        {
            this.environment = environment;
            loggerFactory    = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType()}.log", filters);
            logger           = loggerFactory.CreateLogger(this.GetType().FullName);

            this.clusterId = "test-" + Guid.NewGuid();

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

            fixture.InitializeConnectionStringAccessor(GetConnectionString);
            this.connectionString = fixture.ConnectionString;
            this.siloOptions      = Options.Create(new SiloOptions {
                ClusterId = this.clusterId
            });
            this.clientOptions = Options.Create(new ClusterClientOptions {
                ClusterId = this.clusterId
            });
            var adoVariant = GetAdoInvariant();

            membershipTable = CreateMembershipTable(logger);
            membershipTable.InitializeMembershipTable(true).WithTimeout(TimeSpan.FromMinutes(1)).Wait();

            clientConfiguration = new ClientConfiguration
            {
                ClusterId            = this.clusterId,
                AdoInvariant         = adoVariant,
                DataConnectionString = fixture.ConnectionString
            };

            this.gatewayOptions = Options.Create(new GatewayOptions());
            gatewayListProvider = CreateGatewayListProvider(logger);
            gatewayListProvider.InitializeGatewayListProvider().WithTimeout(TimeSpan.FromMinutes(1)).Wait();
        }
Пример #6
0
        protected MembershipTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment, LoggerFilterOptions filters)
        {
            this.environment = environment;
            loggerFactory    = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType()}.log", filters);
            logger           = new LoggerWrapper <MembershipTableTestsBase>(loggerFactory);

            this.clusterId = "test-" + Guid.NewGuid();

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

            fixture.InitializeConnectionStringAccessor(GetConnectionString);
            this.connectionString = fixture.ConnectionString;
            globalConfiguration   = new GlobalConfiguration
            {
                ClusterId            = this.clusterId,
                AdoInvariant         = GetAdoInvariant(),
                DataConnectionString = fixture.ConnectionString
            };

            membershipTable = CreateMembershipTable(logger);
            membershipTable.InitializeMembershipTable(true).WithTimeout(TimeSpan.FromMinutes(1)).Wait();

            clientConfiguration = new ClientConfiguration
            {
                ClusterId            = globalConfiguration.ClusterId,
                AdoInvariant         = globalConfiguration.AdoInvariant,
                DataConnectionString = globalConfiguration.DataConnectionString
            };

            gatewayListProvider = CreateGatewayListProvider(logger);
            gatewayListProvider.InitializeGatewayListProvider().WithTimeout(TimeSpan.FromMinutes(1)).Wait();
        }
 public PersistenceProviderTests_Local(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output          = output;
     this.fixture         = fixture;
     this.providerRuntime = new ClientProviderRuntime(fixture.InternalGrainFactory, fixture.Services, NullLoggerFactory.Instance);
     this.providerCfgProps.Clear();
 }
Пример #8
0
        protected const string testDatabaseName = "OrleansReminderTest";//for relational storage

        protected ReminderTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture clusterFixture, LoggerFilterOptions filters)
        {
            loggerFactory       = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType()}.log", filters);
            this.ClusterFixture = clusterFixture;
            logger = loggerFactory.CreateLogger <ReminderTableTestsBase>();
            var serviceId = Guid.NewGuid();
            var clusterId = "test-" + serviceId;

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

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            var globalConfiguration = new GlobalConfiguration
            {
                ServiceId = serviceId,
                ClusterId = clusterId,
                AdoInvariantForReminders         = GetAdoInvariant(),
                DataConnectionStringForReminders = fixture.ConnectionString
            };

            var rmndr = CreateRemindersTable();

            rmndr.Init(globalConfiguration).WithTimeout(TimeSpan.FromMinutes(1)).Wait();
            remindersTable = rmndr;
        }
Пример #9
0
        protected const string testDatabaseName = "OrleansReminderTest";//for relational storage

        protected ReminderTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture clusterFixture)
        {
            this.ClusterFixture = clusterFixture;
            LogManager.Initialize(new NodeConfiguration());

            logger = LogManager.GetLogger(GetType().Name, LoggerType.Application);
            var serviceId    = Guid.NewGuid();
            var deploymentId = "test-" + serviceId;

            logger.Info("DeploymentId={0}", deploymentId);

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            var globalConfiguration = new GlobalConfiguration
            {
                ServiceId                        = serviceId,
                DeploymentId                     = deploymentId,
                AdoInvariantForReminders         = GetAdoInvariant(),
                DataConnectionStringForReminders = fixture.ConnectionString
            };

            var rmndr = CreateRemindersTable();

            rmndr.Init(globalConfiguration, logger).WithTimeout(TimeSpan.FromMinutes(1)).Wait();
            remindersTable = rmndr;
        }
Пример #10
0
        protected const string testDatabaseName = "OrleansMembershipTest";//for relational storage

        protected MembershipTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment)
        {
            this.environment = environment;
            LogManager.Initialize(new NodeConfiguration());
            logger       = LogManager.GetLogger(GetType().Name, LoggerType.Application);
            deploymentId = "test-" + Guid.NewGuid();

            logger.Info("DeploymentId={0}", deploymentId);

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            var globalConfiguration = new GlobalConfiguration
            {
                DeploymentId         = deploymentId,
                AdoInvariant         = GetAdoInvariant(),
                DataConnectionString = fixture.ConnectionString
            };

            membershipTable = CreateMembershipTable(logger);
            membershipTable.InitializeMembershipTable(globalConfiguration, true, logger).WithTimeout(TimeSpan.FromMinutes(1)).Wait();

            var clientConfiguration = new ClientConfiguration
            {
                DeploymentId         = globalConfiguration.DeploymentId,
                AdoInvariant         = globalConfiguration.AdoInvariant,
                DataConnectionString = globalConfiguration.DataConnectionString
            };

            gatewayListProvider = CreateGatewayListProvider(logger);
            gatewayListProvider.InitializeGatewayListProvider(clientConfiguration, logger).WithTimeout(TimeSpan.FromMinutes(1)).Wait();
        }
Пример #11
0
 public AzureQueueAdapterTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output        = output;
     this.fixture       = fixture;
     this.deploymentId  = MakeDeploymentId();
     this.loggerFactory = this.fixture.Services.GetService <ILoggerFactory>();
     BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
 }
Пример #12
0
 public AzureQueueAdapterTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output       = output;
     this.fixture      = fixture;
     this.deploymentId = MakeDeploymentId();
     LogManager.Initialize(new NodeConfiguration());
     BufferPool.InitGlobalBufferPool(new MessagingConfiguration(false));
 }
Пример #13
0
 public RequestContextTests_Local(TestEnvironmentFixture fixture)
 {
     this.fixture                       = fixture;
     oldPropagateActivityId             = RequestContext.PropagateActivityId;
     RequestContext.PropagateActivityId = true;
     RequestContextTestUtils.SetActivityId(Guid.Empty);
     RequestContext.Clear();
     headers.Clear();
 }
Пример #14
0
        public PersistenceProviderTests_Local(ITestOutputHelper output, TestEnvironmentFixture fixture)
        {
            this.output  = output;
            this.fixture = fixture;
            var clusterOptions = fixture.Services.GetRequiredService <IOptions <ClusterOptions> >();

            this.providerRuntime = new ClientProviderRuntime(fixture.InternalGrainFactory, fixture.Services, NullLoggerFactory.Instance, clusterOptions);
            this.providerCfgProps.Clear();
        }
Пример #15
0
        public ReminderTests_Azure_Standalone(ITestOutputHelper output, TestEnvironmentFixture fixture)
        {
            this.output  = output;
            this.fixture = fixture;
            log          = LogManager.GetLogger(GetType().Name, LoggerType.Application);

            ServiceId = Guid.NewGuid();

            TestUtils.ConfigureClientThreadPoolSettingsForStorageTests(1000);
        }
 public DynamoDBStorageProviderTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output  = output;
     this.fixture = fixture;
     providerCfgProps["DataConnectionString"] = $"Service={AWSTestConstants.DynamoDbService}";
     this.providerRuntime = new ClientProviderRuntime(
         fixture.InternalGrainFactory,
         fixture.Services,
         fixture.Services.GetRequiredService <ClientGrainContext>());
 }
 public RequestContextTests_Local(TestEnvironmentFixture fixture)
 {
     this.fixture                        = fixture;
     oldPropagateActivityId              = RequestContext.PropagateActivityId;
     RequestContext.PropagateActivityId  = true;
     Trace.CorrelationManager.ActivityId = Guid.Empty;
     RequestContext.Clear();
     headers.Clear();
     GrainClient.ClientInvokeCallback = null;
 }
Пример #18
0
 public PersistenceProviderTests_Local(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output          = output;
     this.fixture         = fixture;
     this.providerRuntime = new ClientProviderRuntime(
         fixture.InternalGrainFactory,
         fixture.Services,
         fixture.Services.GetRequiredService <ClientGrainContext>());
     this.providerCfgProps.Clear();
 }
 public RequestContextTests_Local(TestEnvironmentFixture fixture)
 {
     this.fixture                       = fixture;
     oldPropagateActivityId             = RequestContext.PropagateActivityId;
     RequestContext.PropagateActivityId = true;
     RequestContextTestUtils.SetActivityId(Guid.Empty);
     RequestContext.Clear();
     headers.Clear();
     this.fixture.RuntimeClient.ClientInvokeCallback = null;
 }
        public ReminderTests_Azure_Standalone(ITestOutputHelper output, TestEnvironmentFixture fixture)
        {
            this.output        = output;
            this.fixture       = fixture;
            this.loggerFactory = TestingUtils.CreateDefaultLoggerFactory($"{GetType().Name}.log");
            this.log           = this.loggerFactory.CreateLogger <ReminderTests_Azure_Standalone>();

            this.serviceId = Guid.NewGuid().ToString();

            TestUtils.ConfigureClientThreadPoolSettingsForStorageTests(1000);
        }
Пример #21
0
        public SQSAdapterTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
        {
            if (!AWSTestConstants.IsSqsAvailable)
            {
                throw new SkipException("Empty connection string");
            }

            this.output       = output;
            this.fixture      = fixture;
            this.deploymentId = MakeDeploymentId();
        }
Пример #22
0
 public PersistenceProviderTests_Local(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output            = output;
     this.fixture           = fixture;
     storageProviderManager = new StorageProviderManager(
         fixture.GrainFactory,
         fixture.Services,
         new ClientProviderRuntime(fixture.InternalGrainFactory, fixture.Services));
     storageProviderManager.LoadEmptyStorageProviders().WaitWithThrow(TestConstants.InitTimeout);
     providerCfgProps.Clear();
 }
Пример #23
0
 public PersistenceProviderTests_Local(ITestOutputHelper output, TestEnvironmentFixture fixture)
 {
     this.output          = output;
     this.fixture         = fixture;
     this.providerRuntime = new ClientProviderRuntime(
         fixture.InternalGrainFactory,
         fixture.Services,
         NullLoggerFactory.Instance,
         fixture.Services.GetRequiredService <ImplicitStreamSubscriberTable>(),
         fixture.Services.GetRequiredService <ClientGrainContext>());
     this.providerCfgProps.Clear();
 }
        protected SqlStatisticsPublisherTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment)
        {
            this.environment   = environment;
            this.loggerFactory = TestingUtils.CreateDefaultLoggerFactory(new NodeConfiguration().TraceFileName);
            logger             = new LoggerWrapper <SqlStatisticsPublisherTestsBase>(loggerFactory);

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            ConnectionString = fixture.ConnectionString;

            StatisticsPublisher = new SqlStatisticsPublisher();
            StatisticsPublisher.Init("Test", new StatisticsPublisherProviderRuntime(logger),
                                     new StatisticsPublisherProviderConfig(AdoInvariant, ConnectionString)).Wait();
        }
        protected SqlStatisticsPublisherTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment)
        {
            this.environment = environment;
            this.loggerFactory = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType()}.log");
            logger = loggerFactory.CreateLogger<SqlStatisticsPublisherTestsBase>();

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            ConnectionString = fixture.ConnectionString;

            StatisticsPublisher = new AdoNetStatisticsPublisher();
            StatisticsPublisher.Init("Test", new StatisticsPublisherProviderRuntime(),
                new StatisticsPublisherProviderConfig(AdoInvariant, ConnectionString)).Wait();
        }
        protected SqlStatisticsPublisherTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment)
        {
            this.environment = environment;
            LogManager.Initialize(new NodeConfiguration());
            logger = LogManager.GetLogger(GetType().Name, LoggerType.Application);

            fixture.InitializeConnectionStringAccessor(GetConnectionString);

            ConnectionString = fixture.ConnectionString;

            StatisticsPublisher = new SqlStatisticsPublisher();
            StatisticsPublisher.Init("Test", new StatisticsPublisherProviderRuntime(logger),
                                     new StatisticsPublisherProviderConfig(AdoInvariant, ConnectionString)).Wait();
        }
Пример #27
0
        protected const string testDatabaseName = "OrleansReminderTest";//for relational storage

        protected ReminderTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture clusterFixture, LoggerFilterOptions filters)
        {
            this.connectionStringFixture = fixture;
            fixture.InitializeConnectionStringAccessor(GetConnectionString);
            loggerFactory       = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType()}.log", filters);
            this.ClusterFixture = clusterFixture;
            logger = loggerFactory.CreateLogger <ReminderTableTestsBase>();
            var serviceId = Guid.NewGuid().ToString() + "/foo";
            var clusterId = "test-" + serviceId + "/foo2";

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

            this.remindersTable = this.CreateRemindersTable();
        }
        public DynamoDBStorageProviderTests(TestEnvironmentFixture fixture)
        {
            if (!AWSTestConstants.IsDynamoDbAvailable)
            {
                throw new SkipException("Unable to connect to DynamoDB simulator");
            }

            DefaultProviderRuntime = new ClientProviderRuntime(fixture.InternalGrainFactory, fixture.Services, NullLoggerFactory.Instance);

            var properties = new Dictionary <string, string>();

            properties["DataConnectionString"] = $"Service={AWSTestConstants.Service}";
            var config   = new ProviderConfiguration(properties);
            var provider = new DynamoDBStorageProvider();

            provider.Init("DynamoDBStorageProviderTests", DefaultProviderRuntime, config).Wait();
            PersistenceStorageTests = new CommonStorageTests(fixture.InternalGrainFactory, provider);
        }
Пример #29
0
        protected const string testDatabaseName = "OrleansReminderTest";//for relational storage

        protected ReminderTableTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture clusterFixture, LoggerFilterOptions filters)
        {
            this.connectionStringFixture = fixture;
            fixture.InitializeConnectionStringAccessor(GetConnectionString);
            loggerFactory       = TestingUtils.CreateDefaultLoggerFactory($"{this.GetType()}.log", filters);
            this.ClusterFixture = clusterFixture;
            logger = loggerFactory.CreateLogger <ReminderTableTestsBase>();
            var serviceId = Guid.NewGuid();
            var clusterId = "test-" + serviceId;

            logger.Info("ClusterId={0}", clusterId);
            this.siloOptions = Options.Create(new SiloOptions {
                ClusterId = clusterId, ServiceId = serviceId
            });

            var rmndr = CreateRemindersTable();

            rmndr.Init().WithTimeout(TimeSpan.FromMinutes(1)).Wait();
            remindersTable = rmndr;
        }
        protected SqlStatisticsPublisherTestsBase(ConnectionStringFixture fixture, TestEnvironmentFixture environment)
        {
            this.environment = environment;
            LogManager.Initialize(new NodeConfiguration());
            logger = LogManager.GetLogger(GetType().Name, LoggerType.Application);

            lock (fixture.SyncRoot)
            {
                if (fixture.ConnectionString == null)
                {
                    fixture.ConnectionString = RelationalStorageForTesting.SetupInstance(AdoInvariant, testDatabaseName)
                                               .Result.CurrentConnectionString;
                }
            }

            ConnectionString = fixture.ConnectionString;

            StatisticsPublisher = new SqlStatisticsPublisher();
            StatisticsPublisher.Init("Test", new StatisticsPublisherProviderRuntime(logger),
                                     new StatisticsPublisherProviderConfig(AdoInvariant, ConnectionString)).Wait();
        }
 public BaseSocketTransportTests(TestEnvironmentFixture fixture)
 {
     _fixture = fixture;
 }