Search in sources :

Example 1 with EventLogger

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

the class BrokerFileLoggerStatusListenerTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    _fileLogger = mock(BrokerFileLogger.class);
    _systemConfig = mock(SystemConfig.class);
    EventLogger eventLogger = mock(EventLogger.class);
    when(_systemConfig.getEventLogger()).thenReturn(eventLogger);
    _statusListener = new BrokerFileLoggerImpl.BrokerFileLoggerStatusListener(_fileLogger, _systemConfig);
    when(_fileLogger.getContextValue(Boolean.class, BrokerFileLogger.BROKER_FAIL_ON_LOGGER_IO_ERROR)).thenReturn(true);
}
Also used : BrokerFileLogger(org.apache.qpid.server.logging.logback.BrokerFileLogger) SystemConfig(org.apache.qpid.server.model.SystemConfig) BrokerFileLoggerImpl(org.apache.qpid.server.logging.logback.BrokerFileLoggerImpl) EventLogger(org.apache.qpid.server.logging.EventLogger)

Example 2 with EventLogger

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

the class NonJavaTrustStoreTest 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.getEventLogger()).thenReturn(new EventLogger());
    when(((Broker) _broker).getCategoryClass()).thenReturn(Broker.class);
}
Also used : Broker(org.apache.qpid.server.model.Broker) EventLogger(org.apache.qpid.server.logging.EventLogger)

Example 3 with EventLogger

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

the class SiteSpecificTrustStoreTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    int connectTimeout = Integer.getInteger("SiteSpecificTrustStoreTest.connectTimeout", 1000);
    int readTimeout = Integer.getInteger("SiteSpecificTrustStoreTest.readTimeout", 1000);
    setTestSystemProperty(SiteSpecificTrustStore.TRUST_STORE_SITE_SPECIFIC_CONNECT_TIMEOUT, String.valueOf(connectTimeout));
    setTestSystemProperty(SiteSpecificTrustStore.TRUST_STORE_SITE_SPECIFIC_READ_TIMEOUT, String.valueOf(readTimeout));
    when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
    when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
    when(_broker.getModel()).thenReturn(_model);
    when(_broker.getEventLogger()).thenReturn(new EventLogger());
    when(((Broker) _broker).getCategoryClass()).thenReturn(Broker.class);
}
Also used : Broker(org.apache.qpid.server.model.Broker) EventLogger(org.apache.qpid.server.logging.EventLogger)

Example 4 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)

Example 5 with EventLogger

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

the class BrokerFileLoggerTest method setUp.

@Before
public void setUp() throws Exception {
    _taskExecutor = new TaskExecutorImpl();
    _taskExecutor.start();
    Model model = BrokerModel.getInstance();
    EventLogger eventLogger = mock(EventLogger.class);
    SystemConfig<?> systemConfig = mock(SystemConfig.class);
    when(systemConfig.getModel()).thenReturn(model);
    when(systemConfig.getChildExecutor()).thenReturn(_taskExecutor);
    when(systemConfig.getEventLogger()).thenReturn(eventLogger);
    doReturn(SystemConfig.class).when(systemConfig).getCategoryClass();
    _broker = mock(Broker.class);
    when(_broker.getModel()).thenReturn(model);
    when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
    when(_broker.getParent()).thenReturn(systemConfig);
    doReturn(Broker.class).when(_broker).getCategoryClass();
    _baseFolder = new File(TMP_FOLDER, "test-sub-folder");
    _logFile = new File(_baseFolder, "tmp-broker-host.log." + System.currentTimeMillis());
    if (_baseFolder.exists()) {
        FileUtils.delete(_baseFolder, true);
    }
}
Also used : TaskExecutorImpl(org.apache.qpid.server.configuration.updater.TaskExecutorImpl) Broker(org.apache.qpid.server.model.Broker) EventLogger(org.apache.qpid.server.logging.EventLogger) BrokerModel(org.apache.qpid.server.model.BrokerModel) Model(org.apache.qpid.server.model.Model) File(java.io.File) Before(org.junit.Before)

Aggregations

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