Package org.apache.qpid.server.registry

Examples of org.apache.qpid.server.registry.ApplicationRegistry$StatisticsReportingTask


        configXml.addProperty("virtualhosts.virtualhost(-1).name", getName());
        configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.class", TestableMemoryMessageStore.class.getName());

        ServerConfiguration configuration = new ServerConfiguration(configXml);

        ApplicationRegistry registry = new TestApplicationRegistry(configuration);
        ApplicationRegistry.initialise(registry);
        registry.getVirtualHostRegistry().setDefaultVirtualHostName(getName());

        _virtualHost = registry.getVirtualHostRegistry().getVirtualHost(getName());

        _queueRegistry = _virtualHost.getQueueRegistry();

    }
View Full Code Here


        mainFile.deleteOnExit();
        writeConfigFile(mainFile, false, true, null, "test");

        // Load config
        ApplicationRegistry.remove();
        ApplicationRegistry reg = new ApplicationRegistry(new ServerConfiguration(mainFile));
        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());
View Full Code Here

        writeConfigFile(mainFile, false, false, vhostsFile, null);   
        writeVirtualHostsFile(vhostsFile, "test");

        // Load config
        ApplicationRegistry.remove();
        ApplicationRegistry reg = new ApplicationRegistry(new ServerConfiguration(mainFile));
        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());
View Full Code Here

        mainFile.deleteOnExit();
        writeConfigFile(mainFile, false, false, vhostsFile, null);

        // Load config
        ApplicationRegistry.remove();
        ApplicationRegistry reg = new ApplicationRegistry(new ServerConfiguration(mainFile));
        ApplicationRegistry.initialise(reg);

        // Test config
        VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();

        assertEquals("Incorrect virtualhost count", 2, virtualHostRegistry.getVirtualHosts().size());
       
        // test topic host
        VirtualHost topicVirtualHost = virtualHostRegistry.getVirtualHost("topic");
View Full Code Here

       
        // Load config
        try
        {
            ApplicationRegistry.remove();
            ApplicationRegistry reg = new ApplicationRegistry(new ServerConfiguration(mainFile));
            ApplicationRegistry.initialise(reg);
            fail("Different virtualhost XML configurations not allowed");
        }
        catch (ConfigurationException ce)
        {
View Full Code Here

       
        // Load config
        try
        {
            ApplicationRegistry.remove();
            ApplicationRegistry reg = new ApplicationRegistry(new ServerConfiguration(mainFile));
            ApplicationRegistry.initialise(reg);
            fail("Multiple virtualhost XML configurations not allowed");
        }
        catch (ConfigurationException ce)
        {
View Full Code Here

        config.write("</broker>\n");
        config.close();

        // Load config
        ApplicationRegistry.remove();
        ApplicationRegistry registry = new ApplicationRegistry(new ServerConfiguration(xml));
        ApplicationRegistry.initialise(registry);
        ServerConfiguration serverConfiguration = ApplicationRegistry.getInstance().getConfiguration();

        VirtualHostConfiguration test = serverConfiguration.getVirtualHostConfig("test");
        assertNotNull("Host 'test' is not found", test);
View Full Code Here

    @Override
    public void setUp() throws Exception
    {
        super.setUp();
        //Create Application Registry for test
        ApplicationRegistry applicationRegistry = (ApplicationRegistry)ApplicationRegistry.getInstance();

        PropertiesConfiguration env = new PropertiesConfiguration();
        final VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration(getClass().getName(), env);
        vhostConfig.setMessageStoreClass(TestableMemoryMessageStore.class.getName());
        _virtualHost = new VirtualHostImpl(ApplicationRegistry.getInstance(), vhostConfig);
        applicationRegistry.getVirtualHostRegistry().registerVirtualHost(_virtualHost);

        _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(UUIDGenerator.generateRandomUUID(), _qname.asString(), false, _owner.asString(), false, false, _virtualHost, FieldTable.convertToMap(_arguments));

        _exchange = (DirectExchange)_virtualHost.getExchangeRegistry().getExchange(ExchangeDefaults.DIRECT_EXCHANGE_NAME);
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        //Create Application Registry for test
        ApplicationRegistry applicationRegistry = (ApplicationRegistry)ApplicationRegistry.getInstance();

        PropertiesConfiguration env = new PropertiesConfiguration();
        _virtualHost = new VirtualHostImpl(new VirtualHostConfiguration(getClass().getName(), env), _store);
        applicationRegistry.getVirtualHostRegistry().registerVirtualHost(_virtualHost);

        _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(_qname, false, _owner, false, _virtualHost, _arguments);
    }
View Full Code Here

    QueueRegistry _queueRegistry;
    VirtualHost _virtualHost;

    public void setUp()
    {
        ApplicationRegistry registry = (ApplicationRegistry) ApplicationRegistry.getInstance();

        _virtualHost = registry.getVirtualHostRegistry().getVirtualHost("test");

        _queueRegistry = _virtualHost.getQueueRegistry();

        assertEquals("Queues registered on an empty virtualhost", 0, _queueRegistry.getQueues().size());
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.registry.ApplicationRegistry$StatisticsReportingTask

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.