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);
}
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());
}
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();
}
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;
}
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);
}
Aggregations