Exemplo n.º 1
0
        public Issue_55_CamelCase_Convention_Should_Not_Be_Applied_To_MongoCommit()
        {
            var options = new MongoPersistenceOptions();
            var db      = options.ConnectToDatabase(AcceptanceTestMongoPersistenceFactory.GetConnectionString());

            _commits = db.GetCollection <BsonDocument>("Commits");
        }
        protected override void Context()
        {
            for (int c = 1; c <= ParallelWriters; c++)
            {
                var client = new AcceptanceTestMongoPersistenceFactory().Build();

                if (c == 1)
                {
                    client.Drop();
                }
                client.Initialize();
                _writers.Add(client);
            }

            _observer = new Observer();

            var reader = new AcceptanceTestMongoPersistenceFactory().Build();

            _client = new PollingClient2(reader, c =>
            {
                _observer.OnNext(c);
                return(PollingClient2.HandlingResult.MoveToNext);
            }, PollingInterval);

            _client.StartFrom(0);
        }
Exemplo n.º 3
0
        protected override void Context()
        {
            for (int c = 1; c <= ParallelWriters; c++)
            {
                var client = new AcceptanceTestMongoPersistenceFactory().Build();

                if (c == 1)
                {
                    client.Drop();
                    client.Initialize();
                }

                _writers.Add(client);
            }

            _observer = new Observer();

            var reader = new AcceptanceTestMongoPersistenceFactory().Build();

            _client = new PollingClient(reader, PollingInterval);

            _observeCommits = _client.ObserveFrom(null);
            _subscription   = _observeCommits.Subscribe(_observer);
            _observeCommits.Start();
        }
        protected override void Because()
        {
            var options = new MongoPersistenceOptions(
                (settings) =>
            {
                settings.ApplicationName = TestApplicationName;
                settings.ReplicaSetName  = TestReplicaSetName;
            });

            _db = options.ConnectToDatabase(AcceptanceTestMongoPersistenceFactory.GetConnectionString());
        }
Exemplo n.º 5
0
        public holes_are_not_filled_as_default_behavior()
        {
            var options = new MongoPersistenceOptions();

            options.ConcurrencyStrategy = ConcurrencyExceptionStrategy.Continue;

            var db         = options.ConnectToDatabase(AcceptanceTestMongoPersistenceFactory.GetConnectionString());
            var collection = db.GetCollection <BsonDocument>("Commits");

            options.CheckpointGenerator      = new InMemoryCheckpointGenerator(collection);
            PersistenceEngineFixture.Options = options;

            // workaround for test initialization to have uniform config for all 3 test frameworks
            // we can't use ClassInitialize, TestFixtureSetup or SetFixture
            Fixture.Initialize(ConfiguredPageSizeForTesting);

            // reset this immediately, hopefully will not impact other tests
            PersistenceEngineFixture.Options = null;
        }
Exemplo n.º 6
0
        public Issue40_verify_ability_to_opt_out_stream_head()
        {
            var options = new MongoPersistenceOptions
            {
                ConcurrencyStrategy    = ConcurrencyExceptionStrategy.Continue,
                DisableSnapshotSupport = true
            };

            var db = options.ConnectToDatabase(AcceptanceTestMongoPersistenceFactory.GetConnectionString());

            _streamHeads = db.GetCollection <BsonDocument>("Streams");

            PersistenceEngineFixture.Options = options;

            // workaround for test initialization to have uniform config for all 3 test frameworks
            // we can't use ClassInitialize, TestFixtureSetup or SetFixture
            Fixture.Initialize(ConfiguredPageSizeForTesting);

            // reset this immediately, hopefully will not impact other tests
            PersistenceEngineFixture.Options = null;
        }
        public Verify_safe_generator_not_create_hole()
        {
            var options = new MongoPersistenceOptions
            {
                ConcurrencyStrategy = ConcurrencyExceptionStrategy.Continue
            };

            var db         = options.ConnectToDatabase(AcceptanceTestMongoPersistenceFactory.GetConnectionString());
            var collection = db.GetCollection <BsonDocument>("Commits");

            options.CheckpointGenerator = new AlwaysQueryDbForNextValueCheckpointGenerator(collection);

            PersistenceEngineFixture.Options = options;

            // workaround for test initialization to have uniform config for all 3 test frameworks
            // we can't use ClassInitialize, TestFixtureSetup or SetFixture
            Fixture.Initialize(ConfiguredPageSizeForTesting);

            // reset this immediately, hopefully will not impact other tests
            PersistenceEngineFixture.Options = null;
        }