Package org.apache.qpid.server.configuration.store

Examples of org.apache.qpid.server.configuration.store.JsonConfigurationEntryStore


public class JsonConfigurationStoreFactory implements ConfigurationStoreFactory
{
    @Override
    public ConfigurationEntryStore createStore(String storeLocation, ConfigurationEntryStore initialStore, boolean overwrite, Map<String, String> configProperties)
    {
        return new JsonConfigurationEntryStore(storeLocation, initialStore, overwrite, configProperties);
    }
View Full Code Here


    {
        ConfigurationEntryStore store = _storeCreator.createStore(_userStoreLocation.getAbsolutePath(), "json", BrokerOptions.DEFAULT_INITIAL_CONFIG_LOCATION, false, new BrokerOptions().getConfigProperties());
        assertNotNull("Store was not created", store);
        assertTrue("File should exists", _userStoreLocation.exists());
        assertTrue("File size should be greater than 0", _userStoreLocation.length() > 0);
        JsonConfigurationEntryStore jsonStore = new JsonConfigurationEntryStore(_userStoreLocation.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
        Set<UUID> childrenIds = jsonStore.getRootEntry().getChildrenIds();
        assertFalse("Unexpected children: " + childrenIds, childrenIds.isEmpty());
    }
View Full Code Here

        ConfigurationEntryStore store = _storeCreator.createStore(_userStoreLocation.getAbsolutePath(), "json", _initialStoreFile.getAbsolutePath(), false, Collections.<String,String>emptyMap());
        assertNotNull("Store was not created", store);
        assertTrue("File should exists", _userStoreLocation.exists());
        assertTrue("File size should be greater than 0", _userStoreLocation.length() > 0);
        JsonConfigurationEntryStore jsonStore = new JsonConfigurationEntryStore(_userStoreLocation.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
        ConfigurationEntry entry = jsonStore.getRootEntry();
        assertEquals("Unexpected root id", testBrokerId, entry.getId());
        Map<String, Object> attributes = entry.getAttributes();
        assertNotNull("Unexpected attributes: " + attributes, attributes);
        assertEquals("Unexpected attributes size: " + attributes.size(), 3, attributes.size());
        assertEquals("Unexpected attribute name: " + attributes.get("name"), testBrokerName, attributes.get(Broker.NAME));
        Set<UUID> childrenIds = entry.getChildrenIds();
        assertTrue("Unexpected children: " + childrenIds, childrenIds.isEmpty());

        if(overwrite)
        {
            ConfigurationEntryStore overwrittenStore = _storeCreator.createStore(_userStoreLocation.getAbsolutePath(), "json", BrokerOptions.DEFAULT_INITIAL_CONFIG_LOCATION, true, new BrokerOptions().getConfigProperties());
            assertNotNull("Store was not created", overwrittenStore);
            assertTrue("File should exists", _userStoreLocation.exists());
            assertTrue("File size should be greater than 0", _userStoreLocation.length() > 0);

            //check the contents reflect the test store content having been overwritten with the default store
            JsonConfigurationEntryStore reopenedOverwrittenStore = new JsonConfigurationEntryStore(_userStoreLocation.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
            entry = reopenedOverwrittenStore.getRootEntry();
            assertFalse("Root id did not change, store content was not overwritten", testBrokerId.equals(entry.getId()));
            attributes = entry.getAttributes();
            assertNotNull("No attributes found", attributes);
            assertFalse("Test name should not equal default broker name", testBrokerName.equals(defaultBrokerName));
            assertEquals("Unexpected broker name value" , defaultBrokerName, attributes.get(Broker.NAME));
View Full Code Here

public class JsonConfigurationStoreFactory implements ConfigurationStoreFactory
{
    @Override
    public ConfigurationEntryStore createStore(String storeLocation, ConfigurationEntryStore initialStore, boolean overwrite, Map<String, String> configProperties)
    {
        return new JsonConfigurationEntryStore(storeLocation, initialStore, overwrite, configProperties);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.configuration.store.JsonConfigurationEntryStore

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.