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