public void TestFixtureSetUp()
        {
            _ioDispatcher      = new IODispatcher(_bus, new PublishEnvelope(_bus), true);
            _projectionVersion = new ProjectionVersion(3, 1, 2);
            _projectionConfig  = new ProjectionConfig(SystemAccounts.System, 10, 1000, 1000, 10, true, true, true,
                                                      false,
                                                      false, 5000, 10);
            _positionTagger = new MultiStreamPositionTagger(3, _streams);
            _positionTagger.AdjustTag(CheckpointTag.FromStreamPositions(3,
                                                                        new Dictionary <string, long> {
                { "a", 0 }, { "b", 0 }, { "c", 0 }
            }));
            _namingBuilder = ProjectionNamesBuilder.CreateForTest("projection");

            IODispatcherTestHelpers.SubscribeIODispatcher(_ioDispatcher, _bus);
            _bus.Subscribe <ClientMessage.ReadStreamEventsBackward>(this);

            _coreProjectionCheckpointWriter = new CoreProjectionCheckpointWriter(
                _namingBuilder.MakeCheckpointStreamName(), _ioDispatcher,
                _projectionVersion, _projectionName);

            _checkpointManager = new MultiStreamMultiOutputCheckpointManager(_bus, _projectionId, _projectionVersion,
                                                                             SystemAccounts.System,
                                                                             _ioDispatcher, _projectionConfig, _projectionName, _positionTagger, _namingBuilder, true, true, false,
                                                                             _coreProjectionCheckpointWriter);

            When();
        }
示例#2
0
 private void Given()
 {
     _projection   = "projection";
     _partitionAt  = CheckpointTag.FromPosition(100, 50);
     _partition    = "partition";
     _namesBuilder = ProjectionNamesBuilder.CreateForTest(_projection);
     _re           = new ResultEmitter(_namesBuilder);
 }
 protected override void When()
 {
     // do not create
     _coreProjectionCheckpointWriter =
         new CoreProjectionCheckpointWriter(
             _namingBuilder.MakeCheckpointStreamName(), _ioDispatcher, _projectionVersion, _projectionName);
     _namingBuilder = ProjectionNamesBuilder.CreateForTest("projection");
 }
示例#4
0
 public void setup()
 {
     Given();
     _namingBuilder = ProjectionNamesBuilder.CreateForTest("projection");
     _config        = new ProjectionConfig(null, _checkpointHandledThreshold, _checkpointUnhandledBytesThreshold,
                                           _pendingEventsThreshold, _maxWriteBatchLength, _emitEventEnabled,
                                           _checkpointsEnabled, _createTempStreams, _stopOnEof, false, _trackEmittedStreams, _checkpointAfterMs, _maximumAllowedWritesInFlight);
     When();
 }
 public void setup()
 {
     Given();
     _namingBuilder = ProjectionNamesBuilder.CreateForTest("projection");
     _config        = new ProjectionConfig(null, _checkpointHandledThreshold, _checkpointUnhandledBytesThreshold,
                                           _pendingEventsThreshold, _maxWriteBatchLength, _emitEventEnabled,
                                           _checkpointsEnabled, _createTempStreams, _stopOnEof, isSlaveProjection: false);
     When();
 }
 protected override void Given()
 {
     _ioDispatcher = new IODispatcher(_node.Node.MainQueue, new PublishEnvelope(_node.Node.MainQueue));
     _node.Node.MainBus.Subscribe(_ioDispatcher.BackwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.ForwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Writer);
     _node.Node.MainBus.Subscribe(_ioDispatcher.StreamDeleter);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Awaker);
     _node.Node.MainBus.Subscribe(_ioDispatcher);
     _projectionNamesBuilder = ProjectionNamesBuilder.CreateForTest(_projectionName);
     _emittedStreamsTracker  = new EmittedStreamsTracker(_ioDispatcher, new ProjectionConfig(null, 1000, 1000 * 1000, 100, 500, true, true, false, false, false, _trackEmittedStreams), _projectionNamesBuilder);
     _emittedStreamsDeleter  = new EmittedStreamsDeleter(_ioDispatcher, _projectionNamesBuilder.GetEmittedStreamsName(), _projectionNamesBuilder.GetEmittedStreamsCheckpointName());
 }
示例#7
0
        protected virtual void SetUp()
        {
            _ioDispatcher           = new IODispatcher(_bus, new PublishEnvelope(_bus), true);
            _projectionNamesBuilder = ProjectionNamesBuilder.CreateForTest(_projectionName);
            _checkpointName         = _projectionNamesBuilder.GetEmittedStreamsCheckpointName();

            _deleter = new EmittedStreamsDeleter(_ioDispatcher,
                                                 _projectionNamesBuilder.GetEmittedStreamsName(),
                                                 _checkpointName);

            IODispatcherTestHelpers.SubscribeIODispatcher(_ioDispatcher, _bus);

            _bus.Subscribe <ClientMessage.ReadStreamEventsForward>(this);
            _bus.Subscribe <ClientMessage.ReadStreamEventsBackward>(this);
            _bus.Subscribe <ClientMessage.DeleteStream>(this);

            When();
        }
示例#8
0
 protected override Task Given()
 {
     _ioDispatcher = new IODispatcher(_node.Node.MainQueue, new PublishEnvelope(_node.Node.MainQueue), true);
     _node.Node.MainBus.Subscribe(_ioDispatcher.BackwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.ForwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Writer);
     _node.Node.MainBus.Subscribe(_ioDispatcher.StreamDeleter);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Awaker);
     _node.Node.MainBus.Subscribe <IODispatcherDelayedMessage>(_ioDispatcher);
     _node.Node.MainBus.Subscribe <ClientMessage.NotHandled>(_ioDispatcher);
     _projectionNamesBuilder = ProjectionNamesBuilder.CreateForTest(_projectionName);
     _emittedStreamsTracker  = new EmittedStreamsTracker(_ioDispatcher,
                                                         new ProjectionConfig(null, 1000, 1000 * 1000, 100, 500, true, true, false, false,
                                                                              _trackEmittedStreams, 10000, 1), _projectionNamesBuilder);
     _emittedStreamsDeleter = new EmittedStreamsDeleter(_ioDispatcher,
                                                        _projectionNamesBuilder.GetEmittedStreamsName(),
                                                        _projectionNamesBuilder.GetEmittedStreamsCheckpointName());
     return(Task.CompletedTask);
 }
 public void setup()
 {
     _updateManager = new PartitionStateUpdateManager(ProjectionNamesBuilder.CreateForTest("projection"));
     _updateManager.StateUpdated("partition", new PartitionState("{\"state\":1}", null, _one), _zero);
     _updateManager.StateUpdated("partition", new PartitionState("{\"state\":2}", null, _two), _one);
 }
示例#10
0
 public void setup()
 {
     _namesBuilder = ProjectionNamesBuilder.CreateForTest("projection");
 }
示例#11
0
 public void setup()
 {
     _updateManager = new PartitionStateUpdateManager(ProjectionNamesBuilder.CreateForTest("projection"));
 }
示例#12
0
 public void no_exceptions_are_thrown()
 {
     new PartitionStateUpdateManager(ProjectionNamesBuilder.CreateForTest("projection"));
 }
示例#13
0
 protected override void When()
 {
     // do not create
     _namingBuilder = ProjectionNamesBuilder.CreateForTest("projection");
 }