use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class AbstractStandardVirtualHostNodeTest 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);
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class PreferencesTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final String objectName = getTestName();
_testObject = _model.getObjectFactory().create(TestSingleton.class, Collections.<String, Object>singletonMap(ConfiguredObject.NAME, objectName), null);
_preferenceTaskExecutor = new CurrentThreadTaskExecutor();
_preferenceTaskExecutor.start();
PreferenceStore preferenceStore = mock(PreferenceStore.class);
_testObject.setUserPreferences(new UserPreferencesImpl(_preferenceTaskExecutor, _testObject, preferenceStore, Collections.<Preference>emptySet()));
_testSubject = TestPrincipalUtils.createTestSubject(TEST_USERNAME);
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class JDBCSystemConfigTest method testInvalidTableNamePrefix.
public void testInvalidTableNamePrefix() throws Exception {
final TaskExecutor taskExecutor = new CurrentThreadTaskExecutor();
final EventLogger eventLogger = mock(EventLogger.class);
final Principal systemPrincipal = mock(Principal.class);
JDBCSystemConfig<?> jdbcSystemConfig = new JDBCSystemConfigImpl(taskExecutor, eventLogger, systemPrincipal, Collections.<String, Object>emptyMap());
// This list is not exhaustive
List<String> knownInvalidPrefixes = Arrays.asList("with\"dblquote", "with'quote", "with-dash", "with;semicolon", "with space", "with%percent", "with|pipe", "with(paren", "with)paren", "with[bracket", "with]bracket", "with{brace", "with}brace");
for (String invalidPrefix : knownInvalidPrefixes) {
try {
jdbcSystemConfig.setAttributes(Collections.<String, Object>singletonMap("tableNamePrefix", invalidPrefix));
fail(String.format("Should not be able to set prefix to '%s'", invalidPrefix));
} catch (IllegalConfigurationException e) {
// pass
}
}
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class JDBCVirtualHostTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
_taskExecutor = new CurrentThreadTaskExecutor();
_taskExecutor.start();
}
use of org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor in project qpid-broker-j by apache.
the class JDBCVirtualHostNodeTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
_taskExecutor = new CurrentThreadTaskExecutor();
_taskExecutor.start();
if (_connectionURL != null) {
TestJdbcUtils.shutdownDerby(_connectionURL);
}
}
Aggregations