public void ActivityTestFixtureFixtureTeardown()
        {
            foreach (ActivityTestContext activityTestContext in ActivityTestContexts.Values)
            {
                activityTestContext.Dispose();
            }

            LocalBus.Dispose();

            if (_cancellationTokenSource != null)
            {
                _cancellationTokenSource.Dispose();
            }
            if (_timer != null)
            {
                _timer.Dispose();
            }

            _endpointCache.Clear();

            if (EndpointCache != null)
            {
                EndpointCache.Dispose();
                EndpointCache = null;
            }

            ServiceBusFactory.ConfigureDefaultSettings(x => { x.SetEndpointCache(null); });
        }
 public void TearDown()
 {
     LocalBus.Dispose();
     RemoteBus.Dispose();
     LocalBus  = null;
     RemoteBus = null;
 }
Beispiel #3
0
        protected override void TeardownContext()
        {
            Instances.Each(x => x.Value.Dispose());

            Instances.Clear();

            RemoteBus.Dispose();
            RemoteBus = null;

            RemoteControlBus.Dispose();
            RemoteControlBus = null;

            LocalBus.Dispose();
            LocalBus = null;

            LocalControlBus.Dispose();
            LocalControlBus = null;

            Thread.Sleep(500);

            SubscriptionService.Stop();
            SubscriptionService.Dispose();
            SubscriptionService = null;

            SubscriptionBus.Dispose();
            SubscriptionBus = null;

            base.TeardownContext();
        }
Beispiel #4
0
        public void LocalAndRemoteTestFixtureTeardown()
        {
            LocalBus.Dispose();
            LocalBus = null;

            RemoteBus.Dispose();
            RemoteBus = null;
        }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         LocalBus?.Dispose();
         RemoteBus?.Dispose();
         _connector?.Dispose();
     }
 }
        protected override void TeardownContext()
        {
            if (LocalBus != null)
            {
                LocalBus.Dispose();
            }

            base.TeardownContext();
        }
Beispiel #7
0
        protected override void TeardownContext()
        {
            LocalBus.Dispose();
            LocalBus = null;

            LocalControlBus.Dispose();
            LocalControlBus = null;

            base.TeardownContext();
        }
        protected override void TeardownContext()
        {
            LocalBus.Dispose();
            LocalBus = null;

            RemoteBus.Dispose();
            RemoteBus = null;

            SubscriptionService = null;

            base.TeardownContext();
        }
        protected override void TeardownContext()
        {
            LocalBus.Dispose();
            LocalBus = null;

            RemoteBus.Dispose();
            RemoteBus = null;

            LocalEndpoint      = null;
            LocalErrorEndpoint = null;

            base.TeardownContext();
        }
        public void Should_recover_the_subscriptions_after_restarting()
        {
            Assert.IsTrue(LocalBus.HasSubscription <Hello>().Any(), "Initial subscription not found");

            RemoteBus.Dispose();
            RemoteBus = null;

            LocalBus.Dispose();
            LocalBus = null;

            // now we need to reload the local bus
            LocalBus = ServiceBusFactory.New(ConfigureLocalBus);

            Assert.IsTrue(LocalBus.HasSubscription <Hello>().Any(), "Subscription not found after restart");
        }
Beispiel #11
0
        protected override void TeardownContext()
        {
            RemoteBus.Dispose();
            RemoteBus = null;

            LocalBus.Dispose();
            LocalBus = null;

            Thread.Sleep(500);

            HealthService.Stop();
            HealthService.Dispose();
            HealthService = null;

            SubscriptionService.Stop();
            SubscriptionService.Dispose();
            SubscriptionService = null;

            base.TeardownContext();
        }
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                if (RemoteBus != null)
                {
                    RemoteBus.Dispose();
                }

                if (LocalBus != null)
                {
                    LocalBus.Dispose();
                }

                base.Dispose(true);
            }

            _disposed = true;
        }