Package org.apache.qpid.server.configuration

Examples of org.apache.qpid.server.configuration.ServerConfiguration


        this(configurationURL, null);
    }

    public ConfigurationFileApplicationRegistry(File configurationURL, BundleContext bundleContext) throws ConfigurationException
    {
        super(new ServerConfiguration(configurationURL), bundleContext);
    }
View Full Code Here


        // Call save Configuration to be sure we have saved the test specific
        // file. As the optional status
        saveTestConfiguration();
        saveTestVirtualhosts();

        ServerConfiguration configuration = new ServerConfiguration(_configFile);
        // Don't need to configuration.configure() here as we are just pulling
        // values directly by String.
        return configuration.getConfig().getString(property);
    }
View Full Code Here

public class ConfigurationFileApplicationRegistry extends ApplicationRegistry
{
    public ConfigurationFileApplicationRegistry(File configurationURL) throws ConfigurationException
    {
        super(new ServerConfiguration(configurationURL));
    }
View Full Code Here

            {
                appInfoMap.put(propName, en.getValue().toString());
            }
        }

        ServerConfiguration sc;
        try
        {
            sc = ApplicationRegistry.getInstance().getConfiguration();
            if (null != sc)
            {
                appInfoMap.put("jmxport", sc.getJMXManagementPort() + "");
                appInfoMap.put("port", sc.getPorts().toString());
                appInfoMap.put("version", QpidProperties.getReleaseVersion());
                appInfoMap.put("vhosts", "standalone");
                appInfoMap.put("KeystorePath", sc.getKeystorePath());
                appInfoMap.put("PluginDirectory", sc.getPluginDirectory());
                appInfoMap.put("CertType", sc.getCertType());
                appInfoMap.put("QpidWork", sc.getQpidWork());
                appInfoMap.put("Bind", sc.getBind());
            }
        }
        catch (Exception e)
        {
            // drop everything to be silent
View Full Code Here

        // MemoryMessageStoreLoggingTest setUp itself does not call super.setUp
        //We call super.setUp but this will not start the broker as that is
        //part of the test case.

        // Load the default configuration file to get the list of defined vhosts
        ServerConfiguration configuration = new ServerConfiguration(new File(_configFile.getParent() + "/config.xml"));
        configuration.initialise();
        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");

        // Make them all persistent i.e. Use DerbyMessageStore and
        // test that it logs correctly.
        for (String vhost : vhosts)
        {
View Full Code Here

        // Validation

        assertTrue("MST messages not logged", results.size() > 0);

        // Load VirtualHost list from file.
        ServerConfiguration configuration = new ServerConfiguration(_configFile);
        configuration.initialise();
        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");

        //Validate each vhost logs a creation
        results = waitAndFindMatches("MST-1002");

        assertEquals("Each vhost did not close its store.", vhosts.size(), results.size());

        for (int index = 0; index < results.size(); index++)
        {
            String result = getLogMessage(results, index);;

            // getSlize will return extract the vhost from vh(/test) -> '/test'
            // so remove the '/' to get the name
            String vhostName = AbstractTestLogSubject.getSlice("vh", result).substring(1);

            // To get the store class used in the configuration we need to know
            // the virtualhost name, found above. AND
            // the index that the virtualhost is within the configuration.
            // we can retrive that from the vhosts list previously extracted.
            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");

            // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
            String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

            assertTrue("MST-1002 does not contain a store path" + getMessageString(result),
View Full Code Here

        // Validation

        assertTrue("MST messages not logged", results.size() > 0);

        // Load VirtualHost list from file.
        ServerConfiguration configuration = new ServerConfiguration(_configFile);
        configuration.initialise();
        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");

        //Validate each vhost logs a creation
        results = waitAndFindMatches("MST-1004");

        assertTrue("Each vhost did not close its store.", vhosts.size() <= results.size());

        for (int index = 0; index < results.size(); index++)
        {
            String result = getLogMessage(results, index);;

            if (getMessageString(result).contains("Recovery Start :"))
            {
                //Don't test queue start recoveries
                continue;
            }

            // getSlize will return extract the vhost from vh(/test) -> '/test'
            // so remove the '/' to get the name
            String vhostName = AbstractTestLogSubject.getSlice("vh", result).substring(1);

            // To get the store class used in the configuration we need to know
            // the virtualhost name, found above. AND
            // the index that the virtualhost is within the configuration.
            // we can retrive that from the vhosts list previously extracted.
            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");

            // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
            String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

            assertEquals("MST-1004 does have expected message", "Recovery Start",
View Full Code Here

        // Validation

        assertTrue("MST messages not logged", results.size() > 0);

        // Load VirtualHost list from file.
        ServerConfiguration configuration = new ServerConfiguration(_configFile);
        configuration.initialise();
        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");

        //Validate each vhost logs a creation
        results = waitAndFindMatches("MST-1006");

        assertTrue("Each vhost did not close its store.", vhosts.size() <= results.size());

        for (int index = 0; index < results.size(); index++)
        {
            String result = getLogMessage(results, index);

            if (getMessageString(result).contains("Recovery Complete :"))
            {
                //Don't test queue start recoveries
                continue;
            }

            // getSlize will return extract the vhost from vh(/test) -> '/test'
            // so remove the '/' to get the name
            String vhostName = AbstractTestLogSubject.getSlice("vh", result).substring(1);

            // To get the store class used in the configuration we need to know
            // the virtualhost name, found above. AND
            // the index that the virtualhost is within the configuration.
            // we can retrive that from the vhosts list previously extracted.
            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");

            // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
            String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

            assertEquals("MST-1006 does have expected message", "Recovery Complete",
View Full Code Here

        // Validation

        assertTrue("MST messages not logged", results.size() > 0);

        // Load VirtualHost list from file.
        ServerConfiguration configuration = new ServerConfiguration(_configFile);
        configuration.initialise();
        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");

        //Validate each vhost logs a creation
        results = waitAndFindMatches("MST-1004 : Recovery Start :");

        // We are only looking for the default queue defined in local host being
        // recovered. If other tests have made queues in test then we want to
        // exclude them here.
        results = filterResultsByVirtualHost(results, "/localhost");

        assertEquals("Recovered test queue not found.", 1, results.size());

        String result = getLogMessage(results, 0);

        // getSlize will return extract the vhost from vh(/test) -> '/test'
        // so remove the '/' to get the name
        String vhostName = AbstractTestLogSubject.getSlice("vh", result).substring(1);

        // To get the store class used in the configuration we need to know
        // the virtualhost name, found above. AND
        // the index that the virtualhost is within the configuration.
        // we can retrive that from the vhosts list previously extracted.
        String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");

        // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
        String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

        assertTrue("MST-1006 does end with queue 'test-queue':" + getMessageString(result),
View Full Code Here

        // Validation

        assertTrue("MST messages not logged", results.size() > 0);

        // Load VirtualHost list from file.
        ServerConfiguration configuration = new ServerConfiguration(_configFile);
        configuration.initialise();
        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");

        //Validate each vhost logs a creation
        results = waitAndFindMatches("MST-1006 : Recovery Complete :");

        // We are only looking for the default queue defined in local host being
        // recovered. If other tests have made queues in test then we want to
        // exclude them here.
        results = filterResultsByVirtualHost(results, "/localhost");

        assertEquals("Recovered test queue not found.", 1, results.size());

        String result = getLogMessage(results, 0);

        // getSlize will return extract the vhost from vh(/test) -> '/test'
        // so remove the '/' to get the name
        String vhostName = AbstractTestLogSubject.getSlice("vh", result).substring(1);

        // To get the store class used in the configuration we need to know
        // the virtualhost name, found above. AND
        // the index that the virtualhost is within the configuration.
        // we can retrive that from the vhosts list previously extracted.
        String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");

        // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
        String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

        assertTrue("MST-1006 does end with queue 'test-queue':" + getMessageString(result),
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.configuration.ServerConfiguration

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.