Search in sources :

Example 31 with EventLogger

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

the class BaseActorTestCase method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    _rawLogger = new UnitTestMessageLogger(_statusUpdatesEnabled);
    _eventLogger = new EventLogger(_rawLogger);
}
Also used : EventLogger(org.apache.qpid.server.logging.EventLogger) UnitTestMessageLogger(org.apache.qpid.server.logging.UnitTestMessageLogger)

Example 32 with EventLogger

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

the class AbstractTestMessages method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    BrokerTestHelper.setUp();
    _logger = new UnitTestMessageLogger();
    _eventLogger = new EventLogger(_logger);
}
Also used : EventLogger(org.apache.qpid.server.logging.EventLogger) UnitTestMessageLogger(org.apache.qpid.server.logging.UnitTestMessageLogger)

Example 33 with EventLogger

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

the class PortFactoryTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    SystemConfig systemConfig = mock(SystemConfig.class);
    _portNumber = findFreePort();
    TaskExecutor executor = CurrentThreadTaskExecutor.newStartedInstance();
    when(_authProvider.getName()).thenReturn(_authProviderName);
    when(_broker.getChildren(eq(AuthenticationProvider.class))).thenReturn(Collections.singleton(_authProvider));
    when(_broker.getCategoryClass()).thenReturn(Broker.class);
    when(_broker.getEventLogger()).thenReturn(new EventLogger());
    when(_broker.getParent()).thenReturn(systemConfig);
    when(_broker.getTypeClass()).thenReturn(Broker.class);
    ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
    when(_broker.getObjectFactory()).thenReturn(objectFactory);
    when(_broker.getModel()).thenReturn(objectFactory.getModel());
    when(_authProvider.getModel()).thenReturn(objectFactory.getModel());
    when(_authProvider.getObjectFactory()).thenReturn(objectFactory);
    when(_authProvider.getCategoryClass()).thenReturn(AuthenticationProvider.class);
    when(_authProvider.getMechanisms()).thenReturn(Arrays.asList("PLAIN"));
    when(_keyStore.getModel()).thenReturn(objectFactory.getModel());
    when(_keyStore.getObjectFactory()).thenReturn(objectFactory);
    when(_trustStore.getModel()).thenReturn(objectFactory.getModel());
    when(_trustStore.getObjectFactory()).thenReturn(objectFactory);
    for (ConfiguredObject obj : new ConfiguredObject[] { _authProvider, _broker, _keyStore, _trustStore }) {
        when(obj.getTaskExecutor()).thenReturn(executor);
        when(obj.getChildExecutor()).thenReturn(executor);
    }
    _factory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
    _attributes.put(Port.ID, _portId);
    _attributes.put(Port.NAME, getName());
    _attributes.put(Port.PORT, _portNumber);
    _attributes.put(Port.TRANSPORTS, _tcpStringSet);
    _attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
    _attributes.put(Port.TCP_NO_DELAY, "true");
    _attributes.put(Port.BINDING_ADDRESS, "127.0.0.1");
}
Also used : SystemConfig(org.apache.qpid.server.model.SystemConfig) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) TaskExecutor(org.apache.qpid.server.configuration.updater.TaskExecutor) ConfiguredObjectFactory(org.apache.qpid.server.model.ConfiguredObjectFactory) EventLogger(org.apache.qpid.server.logging.EventLogger) AuthenticationProvider(org.apache.qpid.server.model.AuthenticationProvider) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) ConfiguredObjectFactoryImpl(org.apache.qpid.server.model.ConfiguredObjectFactoryImpl)

Example 34 with EventLogger

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

the class AmqpPortImplTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    _taskExecutor = CurrentThreadTaskExecutor.newStartedInstance();
    Model model = BrokerModel.getInstance();
    SystemConfig systemConfig = mock(SystemConfig.class);
    _broker = BrokerTestHelper.mockWithSystemPrincipal(Broker.class, mock(Principal.class));
    when(_broker.getParent()).thenReturn(systemConfig);
    when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
    when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
    when(_broker.getModel()).thenReturn(model);
    when(_broker.getId()).thenReturn(UUID.randomUUID());
    when(_broker.getCategoryClass()).thenReturn(Broker.class);
    when(_broker.getEventLogger()).thenReturn(new EventLogger());
    KeyStore<?> keyStore = mock(KeyStore.class);
    when(keyStore.getName()).thenReturn(KEYSTORE_NAME);
    when(keyStore.getParent()).thenReturn(_broker);
    TrustStore<?> trustStore = mock(TrustStore.class);
    when(trustStore.getName()).thenReturn(TRUSTSTORE_NAME);
    when(trustStore.getParent()).thenReturn(_broker);
    AuthenticationProvider<?> authProvider = mock(AuthenticationProvider.class);
    when(authProvider.getName()).thenReturn(AUTHENTICATION_PROVIDER_NAME);
    when(authProvider.getParent()).thenReturn(_broker);
    when(authProvider.getMechanisms()).thenReturn(Arrays.asList("PLAIN"));
    when(_broker.getChildren(AuthenticationProvider.class)).thenReturn(Collections.singleton(authProvider));
    when(_broker.getChildren(KeyStore.class)).thenReturn(Collections.singleton(keyStore));
    when(_broker.getChildren(TrustStore.class)).thenReturn(Collections.singleton(trustStore));
    when(_broker.getChildByName(AuthenticationProvider.class, AUTHENTICATION_PROVIDER_NAME)).thenReturn(authProvider);
}
Also used : SystemConfig(org.apache.qpid.server.model.SystemConfig) 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)

Example 35 with EventLogger

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

the class HttpPortImplTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    _taskExecutor = CurrentThreadTaskExecutor.newStartedInstance();
    Model model = BrokerModel.getInstance();
    SystemConfig systemConfig = mock(SystemConfig.class);
    _broker = mock(Broker.class);
    when(_broker.getParent()).thenReturn(systemConfig);
    when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
    when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
    when(_broker.getModel()).thenReturn(model);
    when(_broker.getEventLogger()).thenReturn(new EventLogger());
    when(_broker.getCategoryClass()).thenReturn(Broker.class);
    AuthenticationProvider<?> provider = mock(AuthenticationProvider.class);
    when(provider.getName()).thenReturn(AUTHENTICATION_PROVIDER_NAME);
    when(provider.getParent()).thenReturn(_broker);
    when(provider.getMechanisms()).thenReturn(Arrays.asList("PLAIN"));
    when(_broker.getChildren(AuthenticationProvider.class)).thenReturn(Collections.<AuthenticationProvider>singleton(provider));
    when(_broker.getChildByName(AuthenticationProvider.class, AUTHENTICATION_PROVIDER_NAME)).thenReturn(provider);
}
Also used : SystemConfig(org.apache.qpid.server.model.SystemConfig) 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)

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