示例#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);
        }
示例#2
0
        public void TestFixtureSetUp()
        {
            try
            {
                MongoDbTestConnectionProvider.DropTestsTenant();

                _mapping["docx"] = TestConfig.PathToWordDocument;
                _mapping["xlsx"] = TestConfig.PathToExcelDocument;
                _mapping["pptx"] = TestConfig.PathToPowerpointDocument;
                _mapping["ppsx"] = TestConfig.PathToPowerpointShow;
                _mapping["txt"]  = TestConfig.PathToTextDocument;
                _mapping["odt"]  = TestConfig.PathToOpenDocumentText;
                _mapping["ods"]  = TestConfig.PathToOpenDocumentSpreadsheet;
                _mapping["odp"]  = TestConfig.PathToOpenDocumentPresentation;
                _mapping["rtf"]  = TestConfig.PathToRTFDocument;

                _withLibreOfficeConversion = new LibreOfficeConversion(new JobsHostConfiguration())
                {
                    Logger = new ConsoleLogger()
                };

                _unoConversion = new LibreOfficeUnoConversion(new JobsHostConfiguration())
                {
                    Logger = new ConsoleLogger()
                };

                _unoConversion.CloseOpenOffice();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                throw;
            }
        }
示例#3
0
        public void SetUp()
        {
            _tempLocalDirectory = Path.GetTempPath() + Guid.NewGuid().ToString();
            Directory.CreateDirectory(_tempLocalDirectory);

            if (_blobStoreToTest == "filesystem")
            {
                _sut = new FileSystemBlobStore(MongoDbTestConnectionProvider.OriginalsDb,
                                               "originals",
                                               _tempLocalDirectory,
                                               new CounterService(MongoDbTestConnectionProvider.SystemDb))
                {
                    Logger = new ConsoleLogger()
                };
            }
            else if (_blobStoreToTest == "gridfs")
            {
                MongoDbTestConnectionProvider.DropTestsTenant();

                _sut = new GridFsBlobStore
                       (
                    MongoDbTestConnectionProvider.OriginalsDbLegacy,
                    new CounterService(MongoDbTestConnectionProvider.SystemDb)
                       )
                {
                    Logger = new ConsoleLogger()
                };
            }
        }
        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> >();
        }
        public void SetUp()
        {
            MongoDbTestConnectionProvider.DropTestsTenant();

            _fs = new GridFsBlobStore
                  (
                MongoDbTestConnectionProvider.OriginalsDbLegacy,
                new CounterService(MongoDbTestConnectionProvider.SystemDb)
                  )
            {
                Logger = new ConsoleLogger()
            };
        }
示例#6
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>();
        }
示例#7
0
        public void SetUp()
        {
            _tempLocalDirectory = Path.GetTempPath() + Guid.NewGuid().ToString();
            Directory.CreateDirectory(_tempLocalDirectory);

            if (_blobStoreToTest == "filesystem")
            {
                var fsStore = new FileSystemBlobStore(
                    MongoDbTestConnectionProvider.OriginalsDb,
                    FileSystemBlobStore.OriginalDescriptorStorageCollectionName,
                    _tempLocalDirectory,
                    new CounterService(MongoDbTestConnectionProvider.SystemDb),
                    "",
                    "")
                {
                    Logger = new ConsoleLogger()
                };
                _sut         = fsStore;
                _sutAdvanced = fsStore as IBlobStoreAdvanced;
            }
            else if (_blobStoreToTest == "gridfs")
            {
                MongoDbTestConnectionProvider.DropTestsTenant();

                var gridfsStore = new GridFsBlobStore
                                  (
                    MongoDbTestConnectionProvider.OriginalsDbLegacy,
                    new CounterService(MongoDbTestConnectionProvider.SystemDb)
                                  )
                {
                    Logger = new ConsoleLogger()
                };
                _sut         = gridfsStore;
                _sutAdvanced = gridfsStore as IBlobStoreAdvanced;
            }
        }