Search in sources :

Example 11 with ConfiguredObjectFactoryImpl

use of org.apache.qpid.server.model.ConfiguredObjectFactoryImpl in project qpid-broker-j by apache.

the class HttpManagementTest method setUp.

@Before
public void setUp() throws Exception {
    _id = UUID.randomUUID();
    _broker = mock(Broker.class);
    ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
    when(_broker.getObjectFactory()).thenReturn(objectFactory);
    when(_broker.getModel()).thenReturn(objectFactory.getModel());
    when(_broker.getCategoryClass()).thenReturn(Broker.class);
    when(_broker.getEventLogger()).thenReturn(mock(EventLogger.class));
    TaskExecutor taskExecutor = new TaskExecutorImpl();
    taskExecutor.start();
    when(_broker.getTaskExecutor()).thenReturn(taskExecutor);
    when(_broker.getChildExecutor()).thenReturn(taskExecutor);
    Map<String, Object> attributes = new HashMap<String, Object>();
    attributes.put(HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, false);
    attributes.put(HttpManagement.HTTPS_BASIC_AUTHENTICATION_ENABLED, true);
    attributes.put(HttpManagement.HTTP_SASL_AUTHENTICATION_ENABLED, false);
    attributes.put(HttpManagement.HTTPS_SASL_AUTHENTICATION_ENABLED, true);
    attributes.put(HttpManagement.NAME, getTestName());
    attributes.put(HttpManagement.TIME_OUT, 10000l);
    attributes.put(ConfiguredObject.ID, _id);
    attributes.put(HttpManagement.DESIRED_STATE, State.QUIESCED);
    _management = new HttpManagement(attributes, _broker);
    _management.open();
}
Also used : TaskExecutor(org.apache.qpid.server.configuration.updater.TaskExecutor) TaskExecutorImpl(org.apache.qpid.server.configuration.updater.TaskExecutorImpl) Broker(org.apache.qpid.server.model.Broker) ConfiguredObjectFactory(org.apache.qpid.server.model.ConfiguredObjectFactory) EventLogger(org.apache.qpid.server.logging.EventLogger) HashMap(java.util.HashMap) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) ConfiguredObjectFactoryImpl(org.apache.qpid.server.model.ConfiguredObjectFactoryImpl) Before(org.junit.Before)

Aggregations

ConfiguredObjectFactoryImpl (org.apache.qpid.server.model.ConfiguredObjectFactoryImpl)11 Before (org.junit.Before)9 CurrentThreadTaskExecutor (org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)6 EventLogger (org.apache.qpid.server.logging.EventLogger)6 SystemConfig (org.apache.qpid.server.model.SystemConfig)6 Broker (org.apache.qpid.server.model.Broker)5 ConfiguredObjectFactory (org.apache.qpid.server.model.ConfiguredObjectFactory)5 TaskExecutor (org.apache.qpid.server.configuration.updater.TaskExecutor)4 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)4 HashMap (java.util.HashMap)3 Principal (java.security.Principal)2 AuthenticationProvider (org.apache.qpid.server.model.AuthenticationProvider)2 VirtualHostNode (org.apache.qpid.server.model.VirtualHostNode)2 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)2 ConfiguredObjectRecordHandler (org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler)2 File (java.io.File)1 IllegalConfigurationException (org.apache.qpid.server.configuration.IllegalConfigurationException)1 TaskExecutorImpl (org.apache.qpid.server.configuration.updater.TaskExecutorImpl)1 BrokerImpl (org.apache.qpid.server.model.BrokerImpl)1 VirtualHost (org.apache.qpid.server.model.VirtualHost)1