public void setup()
        {
            //_exception = null;
            try
            {
                _point = new HeadingEventReader(10);
            }
            catch (Exception)
            {
                //_exception = ex;
            }

            _distibutionPointCorrelationId = Guid.NewGuid();
            _point.Start(
                _distibutionPointCorrelationId,
                new TransactionFileEventReader(
                    _ioDispatcher, _bus, _distibutionPointCorrelationId, null, new TFPos(0, -1), new RealTimeProvider()));
            DateTime timestamp = DateTime.UtcNow;
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(20, 10), "stream", 10, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0], timestamp));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(40, 30), "stream", 11, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0], timestamp.AddMilliseconds(1)));
            _subscription = new FakeReaderSubscription();
            _projectionSubscriptionId = Guid.NewGuid();
            _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30);
            _point.Handle(
                new ReaderSubscriptionMessage.EventReaderIdle(
                    _distibutionPointCorrelationId, timestamp.AddMilliseconds(1100)));
        }
        public void setup()
        {
            //_exception = null;
            try
            {
                _point = new HeadingEventReader(10, _bus);
            }
            catch (Exception)
            {
                //_exception = ex;
            }

            _distibutionPointCorrelationId = Guid.NewGuid();
            _point.Start(
                _distibutionPointCorrelationId,
                new TransactionFileEventReader(_bus, _distibutionPointCorrelationId, null, new TFPos(0, -1), new RealTimeProvider()));
            DateTime timestamp = DateTime.UtcNow;

            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(20, 10), "stream", 10, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0], timestamp));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(40, 30), "stream", 11, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0], timestamp.AddMilliseconds(1)));
            _subscription             = new FakeReaderSubscription();
            _projectionSubscriptionId = Guid.NewGuid();
            _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30);
            _point.Handle(
                new ReaderSubscriptionMessage.EventReaderIdle(
                    _distibutionPointCorrelationId, timestamp.AddMilliseconds(1100)));
        }
        public void setup()
        {
            _exception = null;
            try
            {
                _point = new HeadingEventReader(10);
            }
            catch (Exception ex)
            {
                _exception = ex;
            }

            _distibutionPointCorrelationId = Guid.NewGuid();
            _point.Start(
                _distibutionPointCorrelationId,
                new TransactionFileEventReader(
                    _bus, _distibutionPointCorrelationId, null, new TFPos(0, -1), new RealTimeProvider()));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(20, 10), "stream", 10, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(40, 30), "stream", 11, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _subscription = new FakeReaderSubscription();
            _projectionSubscriptionId = Guid.NewGuid();
            var subscribed = _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30);
            Assert.IsTrue(subscribed); // ensure we really unsubscribing.. even if it is tested elsewhere
            _point.Unsubscribe(_projectionSubscriptionId);
        }
        public void setup()
        {
            _exception = null;
            try
            {
                _point = new HeadingEventReader(10);
            }
            catch (Exception ex)
            {
                _exception = ex;
            }
            Assume.That(_exception == null);

            _distibutionPointCorrelationId = Guid.NewGuid();
            _point.Start(
                _distibutionPointCorrelationId,
                new TransactionFileEventReader(_bus, _distibutionPointCorrelationId, null, new TFPos(0, -1), new RealTimeProvider()));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(20, 10), "stream", 10, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(40, 30), "stream", 11, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _subscription = new FakeReaderSubscription();
            _projectionSubscriptionId = Guid.NewGuid();
            _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30);
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(60, 50), "stream", 12, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
        }
Пример #5
0
        public void setup()
        {
            _exception = null;
            try
            {
                _point = new HeadingEventReader(10);
            }
            catch (Exception ex)
            {
                _exception = ex;
            }
            Assume.That(_exception == null);

            _distibutionPointCorrelationId = Guid.NewGuid();
            _point.Start(
                _distibutionPointCorrelationId,
                new TransactionFileEventReader(_bus, _distibutionPointCorrelationId, null, new TFPos(0, -1), new RealTimeProvider()));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(20, 10), "stream", 10, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(40, 30), "stream", 11, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _subscription             = new FakeReaderSubscription();
            _projectionSubscriptionId = Guid.NewGuid();
            _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30);
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(60, 50), "stream", 12, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
        }
Пример #6
0
        public void setup()
        {
            _exception = null;
            try
            {
                _point = new HeadingEventReader(10);
            }
            catch (Exception ex)
            {
                _exception = ex;
            }

            _distibutionPointCorrelationId = Guid.NewGuid();
            _point.Start(
                _distibutionPointCorrelationId,
                new TransactionFileEventReader(
                    _bus, _distibutionPointCorrelationId, null, new TFPos(0, -1), new RealTimeProvider()));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(20, 10), "stream", 10, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _point.Handle(
                ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                    _distibutionPointCorrelationId, new TFPos(40, 30), "stream", 11, false, Guid.NewGuid(),
                    "type", false, new byte[0], new byte[0]));
            _subscription             = new FakeReaderSubscription();
            _projectionSubscriptionId = Guid.NewGuid();
            var subscribed = _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30);

            Assert.IsTrue(subscribed); // ensure we really unsubscribing.. even if it is tested elsewhere
            _point.Unsubscribe(_projectionSubscriptionId);
        }
Пример #7
0
 public IReaderSubscription CreateReaderSubscription(IPublisher publisher, CheckpointTag fromCheckpointTag, Guid subscriptionId, ReaderSubscriptionOptions readerSubscriptionOptions)
 {
     _subscription = new FakeReaderSubscription();
     return(_subscription);
 }