コード例 #1
0
        public DynamoDBStorageProviderTests()
        {
            if (!AWSTestConstants.IsDynamoDbAvailable)
            {
                throw new SkipException("Unable to connect to DynamoDB simulator");
            }

            var testEnvironment = new SerializationTestEnvironment();

            DefaultProviderRuntime = new StorageProviderManager(
                testEnvironment.GrainFactory,
                null,
                new ClientProviderRuntime(testEnvironment.GrainFactory, null));
            ((StorageProviderManager)DefaultProviderRuntime).LoadEmptyStorageProviders().WaitWithThrow(TestConstants.InitTimeout);
            testEnvironment.InitializeForTesting();

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

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

            provider.Init("DynamoDBStorageProviderTests", DefaultProviderRuntime, config).Wait();
            PersistenceStorageTests = new CommonStorageTests(provider);
        }
コード例 #2
0
        private async Task <DynamoDBStorageProvider> InitDynamoDBTableStorageProvider(IProviderRuntime runtime, string storageName)
        {
            Dictionary <string, string> providerCfgProps = new Dictionary <string, string>();
            var store = new DynamoDBStorageProvider();

            providerCfgProps["DataConnectionString"] = DataConnectionString;
            var cfg = new ProviderConfiguration(providerCfgProps, null);
            await store.Init(storageName, runtime, cfg);

            return(store);
        }
コード例 #3
0
        public DynamoDBStorageProviderTests()
        {
            DefaultProviderRuntime = new StorageProviderManager(new GrainFactory(), null);
            ((StorageProviderManager)DefaultProviderRuntime).LoadEmptyStorageProviders(new ClientProviderRuntime(new GrainFactory(), null)).WaitWithThrow(TestConstants.InitTimeout);
            SerializationManager.InitializeForTesting();

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

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

            provider.Init("DynamoDBStorageProviderTests", DefaultProviderRuntime, config).Wait();
            PersistenceStorageTests = new CommonStorageTests(provider);
        }
コード例 #4
0
        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);
        }