예제 #1
0
        public void SetUp()
        {
            var config = new DocumentStoreTestConfiguration(_engineVersion);

            MongoDbTestConnectionProvider.DropTestsTenant();
            config.SetTestAddress(TestConfig.TestHostServiceAddress);
            _documentStoreService = new DocumentStoreBootstrapper();
            _documentStoreService.Start(config);
            _documentStoreClient = new DocumentStoreServiceClient(
                TestConfig.ServerAddress,
                TestConfig.Tenant
                );
            _tenant = ContainerAccessor.Instance.Resolve <TenantManager>().GetTenant(new TenantId(TestConfig.Tenant));

            //Issue: https://github.com/ProximoSrl/Jarvis.DocumentStore/issues/26
            //you need to resolve the IReader that in turns resolves the ProjectionEngine, becauase if you
            //directly resolve the ITriggerProjectionsUpdate, projection engine will be resolved multiple times.
            _tenant.Container.Resolve <IReader <StreamReadModel, Int64> >();
            _projections = _tenant.Container.Resolve <ITriggerProjectionsUpdate>();

            _documentDescriptorCollection = MongoDbTestConnectionProvider.ReadModelDb.GetCollection <DocumentDescriptorReadModel>("rm.DocumentDescriptor");
            _documentCollection           = MongoDbTestConnectionProvider.ReadModelDb.GetCollection <DocumentReadModel>("rm.Document");
            _commitCollection             = MongoDbTestConnectionProvider.ReadModelDb.GetCollection <BsonDocument>("Commits");
            _blobStore = _tenant.Container.Resolve <IBlobStore>();

            MongoFlatMapper.EnableFlatMapping(true);
        }
        public void SetUp()
        {
            var config = new DocumentStoreTestConfiguration();

            MongoDbTestConnectionProvider.DropTestsTenant();
            config.SetTestAddress(TestConfig.ServerAddress);
            _documentStoreService = new DocumentStoreBootstrapper();
            _documentStoreService.Start(config);

            TenantContext.Enter(new TenantId(TestConfig.Tenant));
            var tenant = ContainerAccessor.Instance.Resolve <TenantManager>().Current;

            _bus       = tenant.Container.Resolve <ICommandBus>();
            _filestore = tenant.Container.Resolve <IBlobStore>();
            Assert.IsTrue(_bus is IInProcessCommandBus);

            //Issue: https://github.com/ProximoSrl/Jarvis.DocumentStore/issues/26
            //you need to resolve the IReader that in turns resolves the ProjectionEngine, becauase if you
            //directly resolve the ITriggerProjectionsUpdate, projection engine will be resolved multiple times.
            tenant.Container.Resolve <IReader <StreamReadModel, Int64> >();
            _projections = tenant.Container.Resolve <ITriggerProjectionsUpdate>();

            _handleWriter   = tenant.Container.Resolve <IDocumentWriter>();
            _documentReader = tenant.Container.Resolve <IReader <DocumentDescriptorReadModel, DocumentDescriptorId> >();
        }
예제 #3
0
        public void SetUp()
        {
            BsonClassMapHelper.Clear();

            var config = new DocumentStoreTestConfiguration();

            MongoDbTestConnectionProvider.DropTestsTenant();
            config.SetTestAddress(TestConfig.TestHostServiceAddress);
            _documentStoreService = new DocumentStoreBootstrapper();
            _documentStoreService.Start(config);

            TenantContext.Enter(new TenantId(TestConfig.Tenant));
            var tenant = ContainerAccessor.Instance.Resolve <TenantManager>().Current;

            _writer = tenant.Container.Resolve <IDocumentWriter>();
        }