Search in sources :

Example 16 with EventLogger

use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.

the class AsynchronousMessageStoreRecovererTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    _virtualHost = mock(QueueManagingVirtualHost.class);
    _store = mock(MessageStore.class);
    _storeReader = mock(MessageStore.MessageStoreReader.class);
    when(_virtualHost.getEventLogger()).thenReturn(new EventLogger());
    when(_virtualHost.getMessageStore()).thenReturn(_store);
    when(_store.newMessageStoreReader()).thenReturn(_storeReader);
}
Also used : MessageStore(org.apache.qpid.server.store.MessageStore) EventLogger(org.apache.qpid.server.logging.EventLogger)

Example 17 with EventLogger

use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.

the class SynchronousMessageStoreRecovererTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    _virtualHost = mock(QueueManagingVirtualHost.class);
    when(_virtualHost.getEventLogger()).thenReturn(new EventLogger());
}
Also used : EventLogger(org.apache.qpid.server.logging.EventLogger)

Example 18 with EventLogger

use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.

the class VirtualHostQueueCreationTest method setUp.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void setUp() throws Exception {
    super.setUp();
    EventLogger eventLogger = mock(EventLogger.class);
    ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
    _taskExecutor = new CurrentThreadTaskExecutor();
    _taskExecutor.start();
    SystemConfig<?> context = mock(SystemConfig.class);
    when(context.getEventLogger()).thenReturn(eventLogger);
    when(context.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
    Principal systemPrincipal = mock(Principal.class);
    AccessControl accessControl = BrokerTestHelper.createAccessControlMock();
    Broker broker = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(Broker.class, systemPrincipal, accessControl);
    when(broker.getObjectFactory()).thenReturn(objectFactory);
    when(broker.getCategoryClass()).thenReturn(Broker.class);
    when(broker.getParent()).thenReturn(context);
    when(broker.getModel()).thenReturn(objectFactory.getModel());
    when(broker.getTaskExecutor()).thenReturn(_taskExecutor);
    when(broker.getChildExecutor()).thenReturn(_taskExecutor);
    _virtualHostNode = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(VirtualHostNode.class, systemPrincipal, accessControl);
    when(_virtualHostNode.getParent()).thenReturn(broker);
    when(_virtualHostNode.getConfigurationStore()).thenReturn(mock(DurableConfigurationStore.class));
    when(_virtualHostNode.getObjectFactory()).thenReturn(objectFactory);
    when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());
    when(_virtualHostNode.getTaskExecutor()).thenReturn(_taskExecutor);
    when(_virtualHostNode.getChildExecutor()).thenReturn(_taskExecutor);
    when(_virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
    when(_virtualHostNode.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
    _virtualHost = createHost();
}
Also used : Broker(org.apache.qpid.server.model.Broker) ConfiguredObjectFactory(org.apache.qpid.server.model.ConfiguredObjectFactory) DurableConfigurationStore(org.apache.qpid.server.store.DurableConfigurationStore) EventLogger(org.apache.qpid.server.logging.EventLogger) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) PreferenceStore(org.apache.qpid.server.store.preferences.PreferenceStore) Principal(java.security.Principal) AccessControl(org.apache.qpid.server.security.AccessControl) VirtualHostNode(org.apache.qpid.server.model.VirtualHostNode) ConfiguredObjectFactoryImpl(org.apache.qpid.server.model.ConfiguredObjectFactoryImpl)

Example 19 with EventLogger

use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.

the class AbstractDurableConfigurationStoreTestCase method createTestExchange.

private Exchange<?> createTestExchange() {
    Exchange exchange = mock(Exchange.class);
    Map<String, Object> actualAttributes = new HashMap<>();
    actualAttributes.put("name", getName());
    actualAttributes.put("type", getName() + "Type");
    actualAttributes.put("lifetimePolicy", LifetimePolicy.DELETE_ON_NO_OUTBOUND_LINKS);
    when(exchange.getName()).thenReturn(getName());
    when(exchange.getType()).thenReturn(getName() + "Type");
    when(exchange.isAutoDelete()).thenReturn(true);
    when(exchange.getId()).thenReturn(_exchangeId);
    when(exchange.getCategoryClass()).thenReturn(Exchange.class);
    when(exchange.isDurable()).thenReturn(true);
    when(exchange.getObjectFactory()).thenReturn(_factory);
    when(exchange.getModel()).thenReturn(_factory.getModel());
    TaskExecutor taskExecutor = CurrentThreadTaskExecutor.newStartedInstance();
    when(exchange.getTaskExecutor()).thenReturn(taskExecutor);
    when(exchange.getChildExecutor()).thenReturn(taskExecutor);
    ConfiguredObjectRecord exchangeRecord = mock(ConfiguredObjectRecord.class);
    when(exchangeRecord.getId()).thenReturn(_exchangeId);
    when(exchangeRecord.getType()).thenReturn(Exchange.class.getSimpleName());
    when(exchangeRecord.getAttributes()).thenReturn(actualAttributes);
    when(exchangeRecord.getParents()).thenReturn(Collections.singletonMap(_rootRecord.getType(), _rootRecord.getId()));
    when(exchange.asObjectRecord()).thenReturn(exchangeRecord);
    when(exchange.getEventLogger()).thenReturn(new EventLogger());
    return exchange;
}
Also used : Exchange(org.apache.qpid.server.model.Exchange) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) TaskExecutor(org.apache.qpid.server.configuration.updater.TaskExecutor) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) EventLogger(org.apache.qpid.server.logging.EventLogger) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject)

Example 20 with EventLogger

use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.

the class FileTrustStoreTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
    when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
    when(_broker.getModel()).thenReturn(_model);
    when(_broker.getCategoryClass()).thenReturn(Broker.class);
    when(_broker.getEventLogger()).thenReturn(new EventLogger());
    when(_broker.getTypeClass()).thenReturn(Broker.class);
}
Also used : EventLogger(org.apache.qpid.server.logging.EventLogger)

Aggregations

EventLogger (org.apache.qpid.server.logging.EventLogger)40 Broker (org.apache.qpid.server.model.Broker)15 SystemConfig (org.apache.qpid.server.model.SystemConfig)10 TaskExecutor (org.apache.qpid.server.configuration.updater.TaskExecutor)8 HashMap (java.util.HashMap)7 CurrentThreadTaskExecutor (org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)7 Principal (java.security.Principal)6 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)6 ConfiguredObjectFactoryImpl (org.apache.qpid.server.model.ConfiguredObjectFactoryImpl)6 TaskExecutorImpl (org.apache.qpid.server.configuration.updater.TaskExecutorImpl)5 InetSocketAddress (java.net.InetSocketAddress)4 BrokerModel (org.apache.qpid.server.model.BrokerModel)4 Model (org.apache.qpid.server.model.Model)4 VirtualHostNode (org.apache.qpid.server.model.VirtualHostNode)4 AuthenticatedPrincipal (org.apache.qpid.server.security.auth.AuthenticatedPrincipal)4 IOException (java.io.IOException)3 Map (java.util.Map)3 Subject (javax.security.auth.Subject)3 UnitTestMessageLogger (org.apache.qpid.server.logging.UnitTestMessageLogger)3 AmqpPort (org.apache.qpid.server.model.port.AmqpPort)3