Esempio n. 1
0
        public virtual void OneTimeTearDown()
        {
            Engine.Stop();
#pragma warning disable S2696 // Instance members should not write to "static" fields
            CollectionNames.Customize = name => name;
#pragma warning restore S2696 // Instance members should not write to "static" fields
        }
        protected async Task ConfigureProjectionEngineAsync(Boolean dropCheckpoints = true)
        {
            Engine?.Stop();
            if (dropCheckpoints)
            {
                _checkpoints.Drop();
            }
            _tracker       = new ConcurrentCheckpointTracker(Database);
            _statusChecker = new MongoDirectConcurrentCheckpointStatusChecker(Database);

            var tenantId = new TenantId("engine");

            var config = new ProjectionEngineConfig()
            {
                Slots = new[] { "*" },
                EventStoreConnectionString = _eventStoreConnectionString,
                TenantId   = tenantId,
                BucketInfo = new List <BucketInfo>()
                {
                    new BucketInfo()
                    {
                        Slots = new[] { "*" }, BufferSize = 10
                    }
                },
                DelayedStartInMilliseconds = 0,
                ForcedGcSecondsInterval    = 0,
                EngineVersion = "v2",
            };

            RebuildSettings.Init(OnShouldRebuild(), OnShouldUseNitro());

            var rebuildContext = new RebuildContext(RebuildSettings.NitroMode);

            StorageFactory = new MongoStorageFactory(Database, rebuildContext);

            Engine = new ProjectionEngine(
                _pollingClientFactory,
                Persistence,
                _tracker,
                BuildProjections().ToArray(),
                new NullHouseKeeper(),
                new NullNotifyCommitHandled(),
                config,
                NullLogger.Instance,
                NullLoggerThreadContextManager.Instance);
            Engine.LoggerFactory = Substitute.For <ILoggerFactory>();
            Engine.LoggerFactory.Create(Arg.Any <Type>()).Returns(NullLogger.Instance);
            await OnStartPolling().ConfigureAwait(false);
        }
Esempio n. 3
0
 public virtual void TestFixtureTearDown()
 {
     Engine.Stop();
     _eventStore.Dispose();
     CollectionNames.Customize = name => name;
 }