Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.Broker


    }

    public void testAttributeSet()
    {
        notifyBrokerStarted();
        Broker broker = mock(Broker.class);
        when(broker.getCategoryClass()).thenReturn(Broker.class);
        _listener.attributeSet(broker, Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, null, 1);
        verify(_store).save(any(ConfigurationEntry.class));
    }
View Full Code Here


        verifyNoMoreInteractions(_store);
    }

    private void notifyBrokerStarted()
    {
        Broker broker = mock(Broker.class);
        _listener.stateChanged(broker, State.INITIALISING, State.ACTIVE);
    }
View Full Code Here

    public static Broker createBrokerMock()
    {
        SubjectCreator subjectCreator = mock(SubjectCreator.class);
        when(subjectCreator.getMechanisms()).thenReturn("");
        Broker broker = mock(Broker.class);
        when(broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT)).thenReturn(1);
        when(broker.getAttribute(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE)).thenReturn(false);
        when(broker.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(10000l);
        when(broker.getId()).thenReturn(UUID.randomUUID());
        when(broker.getSubjectCreator(any(SocketAddress.class))).thenReturn(subjectCreator);
        when(broker.getVirtualHostRegistry()).thenReturn(new VirtualHostRegistry(new EventLogger()));
        when(broker.getSecurityManager()).thenReturn(new SecurityManager(mock(Broker.class), false));
        when(broker.getEventLogger()).thenReturn(new EventLogger());
        return broker;
    }
View Full Code Here

    }

    public void testChildAdded()
    {
        notifyBrokerStarted();
        Broker broker = mock(Broker.class);
        VirtualHost child = mock(VirtualHost.class);
        _listener.childAdded(broker, child);
        verify(_store).save(any(ConfigurationEntry.class), any(ConfigurationEntry.class));
    }
View Full Code Here

    }

    public void testChildRemoved()
    {
        notifyBrokerStarted();
        Broker broker = mock(Broker.class);
        VirtualHost child = mock(VirtualHost.class);
        _listener.childRemoved(broker, child);
        verify(_store).save(any(ConfigurationEntry.class));
    }
View Full Code Here

    }

    public void testAttributeSet()
    {
        notifyBrokerStarted();
        Broker broker = mock(Broker.class);
        _listener.attributeSet(broker, Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, null, 1);
        verify(_store).save(any(ConfigurationEntry.class));
    }
View Full Code Here

        verifyNoMoreInteractions(_store);
    }

    private void notifyBrokerStarted()
    {
        Broker broker = mock(Broker.class);
        _listener.stateChanged(broker, State.INITIALISING, State.ACTIVE);
    }
View Full Code Here

        if(saslServer.isComplete())
        {
            Subject subject = subjectCreator.createSubjectWithGroups(saslServer.getAuthorizationID());

            Broker broker = getBroker();
            LogActor actor = HttpManagementUtil.getOrCreateAndCacheLogActor(request, broker);
            if (!HttpManagementUtil.hasAccessToManagement(broker.getSecurityManager(), subject, actor))
            {
                sendError(response, HttpServletResponse.SC_FORBIDDEN);
                return;
            }
View Full Code Here

        BrokerTestHelper.setUp();
        XMLConfiguration configXml = new XMLConfiguration();
        configXml.addProperty("store.class", TestableMemoryMessageStore.class.getName());


        Broker broker = BrokerTestHelper.createBrokerMock();
        if (getName().equals("testDeadLetterQueueDoesNotInheritDLQorMDCSettings"))
        {
            when(broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(5);
            when(broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
        }

        _virtualHost = BrokerTestHelper.createVirtualHost(new VirtualHostConfiguration(getName(), configXml, broker));

        _queueRegistry = _virtualHost.getQueueRegistry();
View Full Code Here

        Map<String, Object> attributes = new HashMap<String, Object>();

        QpidServiceLoader<AuthenticationManagerFactory> authManagerFactoryServiceLoader = mock(QpidServiceLoader.class);
        AuthenticationManagerFactory authenticationManagerFactory = mock(AuthenticationManagerFactory.class);

        Broker broker = mock(Broker.class);

        when(authManagerFactoryServiceLoader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(
                Collections.singleton(authenticationManagerFactory));
        when(authenticationManagerFactory.createInstance(attributes)).thenReturn(authenticationManager);
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.Broker

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.