public void FixtureTearDown()
        {
            var brokerAdmin = new RabbitBrokerAdmin();

            brokerAdmin.StopBrokerApplication();
            brokerAdmin.StopNode();
        }
Пример #2
0
        public void FixtureSetUp()
        {
            this.BeforeFixtureSetUp();

            // Eventually add some kind of logic here to start up the broker if it is not running.
            this.AfterFixtureSetUp();

            try
            {
                if (environment.IsActive())
                {
                    // Set up broker admin for non-root user
                    this.brokerAdmin = BrokerTestUtils.GetRabbitBrokerAdmin(); // "rabbit@LOCALHOST", 5672);
                    this.brokerAdmin.StartNode();
                }
            }
            catch (Exception ex)
            {
                Logger.Error("An error occurred during SetUp", ex);
                Assert.Fail("An error occurred during SetUp.");
            }

            if (!this.brokerIsRunning.Apply())
            {
                Assert.Ignore("Rabbit broker is not running. Ignoring integration test fixture.");
            }
        }
        public void FixtureSetUp()
        {
            var brokerAdmin = new RabbitBrokerAdmin();

            brokerAdmin.StartupTimeout = 10000;
            brokerAdmin.StartBrokerApplication();
            this.brokerIsRunning = BrokerRunning.IsRunningWithEmptyQueues(ROUTE);
        }
        /// <summary>Gets the rabbit broker admin.</summary>
        /// <param name="nodeName">Name of the node.</param>
        /// <param name="port">The port.</param>
        /// <returns>The Spring.Messaging.Amqp.Rabbit.Admin.RabbitBrokerAdmin.</returns>
        /// Convenience factory for a {@link RabbitBrokerAdmin} instance that will usually start and stop cleanly on all
        /// systems.
        /// @param nodeName the name of the node
        /// @param port the port to listen on
        /// @return a {@link RabbitBrokerAdmin} instance
        public static RabbitBrokerAdmin GetRabbitBrokerAdmin(string nodeName, int port)
        {
            var brokerAdmin = new RabbitBrokerAdmin(nodeName, port);

            brokerAdmin.RabbitLogBaseDirectory    = "target/rabbitmq/log";
            brokerAdmin.RabbitMnesiaBaseDirectory = "target/rabbitmq/mnesia";
            brokerAdmin.StartupTimeout            = 10000L;
            return(brokerAdmin);
        }
Пример #5
0
        public static void GlobalFixtureSetup()
        {
            StartFederationProxy();
            StartAlternativePortProxy();

            Environment.SetEnvironmentVariable("RABBITMQ_SERVER", @"..\..\..\..\RabbitMQServer");
            Environment.SetEnvironmentVariable("RABBITMQ_SERVER_START_ARGS", "-setcookie RogerIntegrationTests");

            Broker = new RabbitBrokerAdmin(cookie: "RogerIntegrationTests")
            {
                StartupTimeout = 10000
            };
            BrokerHttp = new ResbitClient(Constants.HostName);

            TryStartBroker();

            EnsureBrokerRunning();

            SetupSecondaryVirtualHost();

            SetupFederationExchanges();
        }
        public void FixtureSetUp()
        {
            NamespaceParserRegistry.RegisterParser(typeof(RabbitNamespaceHandler));
            try
            {
                if (Environment.IsActive())
                {
                    // Set up broker admin for non-root user
                    this.brokerAdmin = BrokerTestUtils.GetRabbitBrokerAdmin(); // "rabbit@LOCALHOST", 5672);
                    this.brokerAdmin.StartNode();
                }
            }
            catch (Exception ex)
            {
                Logger.Error("An error occurred during SetUp", ex);
                Assert.Fail("An error occurred during SetUp.");
            }

            if (!this.brokerFederated.Apply())
            {
                Assert.Ignore("Rabbit broker is not running. Ignoring integration test fixture.");
            }
        }