Package org.apache.qpid.server.store

Examples of org.apache.qpid.server.store.DurableConfigurationStore


     *  Tests activating a virtualhostnode with a blueprint context variable.  Config store
     *  does not specify a virtualhost.  Checks virtualhost is created from the blueprint.
     */
    public void testActivateVHNWithVHBlueprint_StoreHasNoVH() throws Exception
    {
        DurableConfigurationStore configStore = new NullMessageStore() {};

        String vhBlueprint = String.format("{ \"type\" : \"%s\", \"name\" : \"%s\"}",
                                           TestMemoryVirtualHost.VIRTUAL_HOST_TYPE,
                                           TEST_VIRTUAL_HOST_NAME);
        Map<String, String> context = Collections.singletonMap(AbstractVirtualHostNode.VIRTUALHOST_BLUEPRINT_CONTEXT_VAR, vhBlueprint);
View Full Code Here


     *  but the virtualhostInitialConfiguration set to empty.  Config store does not specify a virtualhost.
     *  Checks virtualhost is not recreated from the blueprint.
     */
    public void testActivateVHNWithVHBlueprintUsed_StoreHasNoVH() throws Exception
    {
        DurableConfigurationStore configStore = configStoreThatProducesNoRecords();

        String vhBlueprint = String.format("{ \"type\" : \"%s\", \"name\" : \"%s\"}",
                                           TestMemoryVirtualHost.VIRTUAL_HOST_TYPE,
                                           TEST_VIRTUAL_HOST_NAME);
        Map<String, String> context = new HashMap<>();
View Full Code Here

    public void testActivateVHNWithVHBlueprint_StoreHasExistingVH() throws Exception
    {
        UUID virtualHostId = UUID.randomUUID();
        ConfiguredObjectRecord record = createVirtualHostConfiguredObjectRecord(virtualHostId);

        DurableConfigurationStore configStore = configStoreThatProduces(record);

        String vhBlueprint = String.format("{ \"type\" : \"%s\", \"name\" : \"%s\"}",
                                           TestMemoryVirtualHost.VIRTUAL_HOST_TYPE,
                                           "vhFromBlueprint");
        Map<String, String> context = Collections.singletonMap(AbstractVirtualHostNode.VIRTUALHOST_BLUEPRINT_CONTEXT_VAR, vhBlueprint);
View Full Code Here

        assertEquals("Unexpected virtual host id", virtualHostId, virtualHost.getId());
    }

    public void testStopStartVHN() throws Exception
    {
        DurableConfigurationStore configStore = configStoreThatProducesNoRecords();

        Map<String, Object> nodeAttributes = new HashMap<>();
        nodeAttributes.put(VirtualHostNode.NAME, TEST_VIRTUAL_HOST_NODE_NAME);
        nodeAttributes.put(VirtualHostNode.ID, _nodeId);
View Full Code Here

    public void testUpdateVHNDeniedByACL() throws Exception
    {
        when(_broker.getSecurityManager()).thenReturn(_mockSecurityManager);

        DurableConfigurationStore configStore = configStoreThatProducesNoRecords();

        Map<String, Object> nodeAttributes = new HashMap<>();
        nodeAttributes.put(VirtualHostNode.NAME, TEST_VIRTUAL_HOST_NODE_NAME);
        nodeAttributes.put(VirtualHostNode.ID, _nodeId);
View Full Code Here

    public void testDeleteVHNDeniedByACL() throws Exception
    {
        SecurityManager mockSecurityManager = mock(SecurityManager.class);
        when(_broker.getSecurityManager()).thenReturn(mockSecurityManager);

        DurableConfigurationStore configStore = configStoreThatProducesNoRecords();

        Map<String, Object> nodeAttributes = new HashMap<>();
        nodeAttributes.put(VirtualHostNode.NAME, TEST_VIRTUAL_HOST_NODE_NAME);
        nodeAttributes.put(VirtualHostNode.ID, _nodeId);
View Full Code Here

    public void testStopVHNDeniedByACL() throws Exception
    {
        SecurityManager mockSecurityManager = mock(SecurityManager.class);
        when(_broker.getSecurityManager()).thenReturn(mockSecurityManager);

        DurableConfigurationStore configStore = configStoreThatProducesNoRecords();

        Map<String, Object> nodeAttributes = new HashMap<>();
        nodeAttributes.put(VirtualHostNode.NAME, TEST_VIRTUAL_HOST_NODE_NAME);
        nodeAttributes.put(VirtualHostNode.ID, _nodeId);
View Full Code Here

    public void testValidateOnCreateFails() throws Exception
    {
        String nodeName = getTestName();
        Map<String, Object> attributes = Collections.<String, Object>singletonMap(TestVirtualHostNode.NAME, nodeName);

        final DurableConfigurationStore store = mock(DurableConfigurationStore.class);
        doThrow(new RuntimeException("Cannot open store")).when(store).openConfigurationStore(any(ConfiguredObject.class), any(boolean.class));
        AbstractStandardVirtualHostNode node = createAbstractStandardVirtualHostNode(attributes, store);

        try
        {
View Full Code Here

    public void testValidateOnCreateSucceeds() throws Exception
    {
        String nodeName = getTestName();
        Map<String, Object> attributes = Collections.<String, Object>singletonMap(TestVirtualHostNode.NAME, nodeName);

        final DurableConfigurationStore store = mock(DurableConfigurationStore.class);
        AbstractStandardVirtualHostNode node = createAbstractStandardVirtualHostNode(attributes, store);

        node.validateOnCreate();
        verify(store).openConfigurationStore(node, false);
        verify(store).closeConfigurationStore();
View Full Code Here

    public void testOpenFails() throws Exception
    {
        String nodeName = getTestName();
        Map<String, Object> attributes = Collections.<String, Object>singletonMap(TestVirtualHostNode.NAME, nodeName);

        DurableConfigurationStore store = mock(DurableConfigurationStore.class);
        AbstractVirtualHostNode node = new TestAbstractVirtualHostNode( _broker, attributes, store);
        node.open();
        assertEquals("Unexpected node state", State.ERRORED, node.getState());
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.store.DurableConfigurationStore

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.