use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class TestAbstractCarImpl method newTaskExecutor.
private static CurrentThreadTaskExecutor newTaskExecutor() {
CurrentThreadTaskExecutor currentThreadTaskExecutor = new CurrentThreadTaskExecutor();
currentThreadTaskExecutor.start();
return currentThreadTaskExecutor;
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class BrokerRecovererTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
_taskExecutor = new CurrentThreadTaskExecutor();
_taskExecutor.start();
_systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class), null, new HashMap<String, Object>()) {
{
updateModel(BrokerModel.getInstance());
}
};
when(_brokerEntry.getId()).thenReturn(_brokerId);
when(_brokerEntry.getType()).thenReturn(Broker.class.getSimpleName());
Map<String, Object> attributesMap = new HashMap<String, Object>();
attributesMap.put(Broker.MODEL_VERSION, BrokerModel.MODEL_VERSION);
attributesMap.put(Broker.NAME, getName());
when(_brokerEntry.getAttributes()).thenReturn(attributesMap);
when(_brokerEntry.getParents()).thenReturn(Collections.singletonMap(SystemConfig.class.getSimpleName(), _systemConfig.getId()));
// Add a base AuthenticationProvider for all tests
_authenticationProvider1 = mock(AuthenticationProvider.class);
when(_authenticationProvider1.getName()).thenReturn("authenticationProvider1");
when(_authenticationProvider1.getId()).thenReturn(_authenticationProvider1Id);
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class BrokerStoreUpgraderAndRecovererTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
_virtaulHosts = new ArrayList<>();
_hostId = UUID.randomUUID();
_brokerId = UUID.randomUUID();
Map<String, Object> brokerAttributes = new HashMap<>();
brokerAttributes.put("createdTime", BROKER_CREATE_TIME);
brokerAttributes.put("defaultVirtualHost", VIRTUALHOST_NAME);
brokerAttributes.put("modelVersion", "1.3");
brokerAttributes.put("name", BROKER_NAME);
brokerAttributes.put("virtualhosts", _virtaulHosts);
_brokerRecord = mock(ConfiguredObjectRecord.class);
when(_brokerRecord.getId()).thenReturn(_brokerId);
when(_brokerRecord.getType()).thenReturn("Broker");
when(_brokerRecord.getAttributes()).thenReturn(brokerAttributes);
_taskExecutor = new CurrentThreadTaskExecutor();
_taskExecutor.start();
_systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class), null, new HashMap<String, Object>());
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class PreferencesRecovererTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
_store = mock(PreferenceStore.class);
_testObject = _model.getObjectFactory().create(TestCar.class, Collections.<String, Object>singletonMap(ConfiguredObject.NAME, getTestName()), null);
_testChildObject = _testObject.createChild(TestEngine.class, Collections.<String, Object>singletonMap(ConfiguredObject.NAME, getTestName()));
_testSubject = TestPrincipalUtils.createTestSubject(TEST_USERNAME);
_preferenceTaskExecutor = new CurrentThreadTaskExecutor();
_preferenceTaskExecutor.start();
_recoverer = new PreferencesRecoverer(_preferenceTaskExecutor);
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class RedirectingVirtualHostNodeTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
_broker = BrokerTestHelper.createBrokerMock();
SystemConfig<?> systemConfig = (SystemConfig<?>) _broker.getParent();
when(systemConfig.getObjectFactory()).thenReturn(new ConfiguredObjectFactoryImpl(mock(Model.class)));
_taskExecutor = new CurrentThreadTaskExecutor();
_taskExecutor.start();
when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
AuthenticationProvider dummyAuthProvider = mock(AuthenticationProvider.class);
when(dummyAuthProvider.getName()).thenReturn("dummy");
when(dummyAuthProvider.getId()).thenReturn(UUID.randomUUID());
when(dummyAuthProvider.getMechanisms()).thenReturn(Arrays.asList("PLAIN"));
when(_broker.getChildren(eq(AuthenticationProvider.class))).thenReturn(Collections.singleton(dummyAuthProvider));
final Map<String, Object> attributes = new HashMap<>();
attributes.put(Port.NAME, getTestName());
attributes.put(Port.PORT, 0);
attributes.put(Port.AUTHENTICATION_PROVIDER, "dummy");
attributes.put(Port.TYPE, "AMQP");
_port = (AmqpPort) _broker.getObjectFactory().create(Port.class, attributes, _broker);
}
Aggregations