Package org.apache.qpid.server.virtualhost

Examples of org.apache.qpid.server.virtualhost.VirtualHost


                               initialPoolSize);

         // Start the broker now.
         super.createBroker();

         VirtualHost vhost =
                 ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(getName());

         assertEquals("HouseKeeping PoolSize not set correctly.",
                      initialPoolSize, vhost.getHouseKeepingPoolSize());

         vhost.setHouseKeepingPoolSize(1);

         assertEquals("HouseKeeping PoolSize not correctly change.",
                      1, vhost.getHouseKeepingPoolSize());

     }
View Full Code Here


        ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
        ApplicationRegistry.initialise(reg);
   
        // Test config
        VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
        VirtualHost virtualHost = virtualHostRegistry.getVirtualHost("test");

        assertEquals("Incorrect virtualhost count", 1, virtualHostRegistry.getVirtualHosts().size());
        assertEquals("Incorrect virtualhost name", "test", virtualHost.getName());
    }
View Full Code Here

        ApplicationRegistry.initialise(reg);

        // Test config
        VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
        String defaultVirtualHost = reg.getConfiguration().getDefaultVirtualHost();
        VirtualHost virtualHost = virtualHostRegistry.getVirtualHost("test");
        Exchange exchange = virtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.topic"));

        assertEquals("Incorrect default host", "test", defaultVirtualHost);
        assertEquals("Incorrect virtualhost count", 1, virtualHostRegistry.getVirtualHosts().size());
        assertEquals("Incorrect virtualhost name", "test", virtualHost.getName());
        assertEquals("Incorrect exchange type", "topic", exchange.getType().getName().toString());
    }
View Full Code Here

        ApplicationRegistry.initialise(reg);

        // Test config
        VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
        String defaultVirtualHost = reg.getConfiguration().getDefaultVirtualHost();
        VirtualHost virtualHost = virtualHostRegistry.getVirtualHost("test");
        Exchange exchange = virtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.topic"));

        assertEquals("Incorrect default host", "test", defaultVirtualHost);
        assertEquals("Incorrect virtualhost count", 1, virtualHostRegistry.getVirtualHosts().size());
        assertEquals("Incorrect virtualhost name", "test", virtualHost.getName());
        assertEquals("Incorrect exchange type", "topic", exchange.getType().getName().toString());
    }
View Full Code Here

        VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();

        assertEquals("Incorrect virtualhost count", 2, virtualHostRegistry.getVirtualHosts().size());
       
        // test topic host
        VirtualHost topicVirtualHost = virtualHostRegistry.getVirtualHost("topic");
        Exchange topicExchange = topicVirtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.topic"));
       
        assertEquals("Incorrect topic virtualhost name", "topic", topicVirtualHost.getName());
        assertEquals("Incorrect topic exchange type", "topic", topicExchange.getType().getName().toString());
       
        // Test fanout host
        VirtualHost fanoutVirtualHost = virtualHostRegistry.getVirtualHost("fanout");
        Exchange fanoutExchange = fanoutVirtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.fanout"));
       
        assertEquals("Incorrect fanout virtualhost name", "fanout", fanoutVirtualHost.getName());
        assertEquals("Incorrect fanout exchange type", "fanout", fanoutExchange.getType().getName().toString());
    }
View Full Code Here

        reloadVirtualHost();
    }

    protected void reloadVirtualHost()
    {
        VirtualHost original = getVirtualHost();

        if (getVirtualHost() != null)
        {
            try
            {
View Full Code Here

    private void verifyBrokerState()
    {
        IApplicationRegistry registry = ApplicationRegistry.getInstance();

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);
        assertNotNull("Unable to get test Vhost", testVhost);
        assertNotNull("Unable to get test queue registry", testVhost.getQueueRegistry());
        AMQQueue q = testVhost.getQueueRegistry().getQueue(new AMQShortString(QUEUE));
        assertNotNull("Unable to get test queue", q);
        assertEquals("Queue count too big", 0, q.getMessageCount());
    }
View Full Code Here

    // todo: collect to a general testing class - duplicated in AMQQueueMBeanTest
    private void getBrokerInitialState()
    {
        IApplicationRegistry registry = ApplicationRegistry.getInstance();

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);

        assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());

        _initialContentBodyMapSize = store.getContentBodyMap() == null ? 0 : store.getContentBodyMap().size();
        _initilaMessageMetaDataMapSize = store.getMessageMetaDataMap() == null ? 0 : store.getMessageMetaDataMap().size();

        if (_initialContentBodyMapSize != 0)
View Full Code Here

    private void verifyBrokerState()
    {
        IApplicationRegistry registry = ApplicationRegistry.getInstance();

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);

        assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());


        assertNotNull("ContentBodyMap should not be null", store.getContentBodyMap());

        // If the CBM has content it may be due to the broker not yet purging.
View Full Code Here

    }

    protected void peer(AMQStateManager stateManager, AMQMethodEvent<A> evt) throws AMQException
    {
        AMQProtocolSession session = stateManager.getProtocolSession();
        VirtualHost virtualHost = session.getVirtualHost();
        ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
        QueueRegistry queueRegistry = virtualHost.getQueueRegistry();

        local(stateManager, evt);
        _logger.debug(new LogMessage("Handled {0} locally", evt.getMethod()));
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.virtualhost.VirtualHost

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.