Search in sources :

Example 6 with CurrentThreadTaskExecutor

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);
}
Also used : SystemConfig(org.apache.qpid.server.model.SystemConfig) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) ConfiguredObjectFactoryImpl(org.apache.qpid.server.model.ConfiguredObjectFactoryImpl)

Example 7 with CurrentThreadTaskExecutor

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);
}
Also used : UserPreferencesImpl(org.apache.qpid.server.model.preferences.UserPreferencesImpl) Preference(org.apache.qpid.server.model.preferences.Preference) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) PreferenceStore(org.apache.qpid.server.store.preferences.PreferenceStore)

Example 8 with CurrentThreadTaskExecutor

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
        }
    }
}
Also used : CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) TaskExecutor(org.apache.qpid.server.configuration.updater.TaskExecutor) EventLogger(org.apache.qpid.server.logging.EventLogger) CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor) IllegalConfigurationException(org.apache.qpid.server.configuration.IllegalConfigurationException) Principal(java.security.Principal)

Example 9 with CurrentThreadTaskExecutor

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();
}
Also used : CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)

Example 10 with CurrentThreadTaskExecutor

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);
    }
}
Also used : CurrentThreadTaskExecutor(org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)

Aggregations

CurrentThreadTaskExecutor (org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor)23 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)8 HashMap (java.util.HashMap)7 PreferenceStore (org.apache.qpid.server.store.preferences.PreferenceStore)5 EventLogger (org.apache.qpid.server.logging.EventLogger)4 Broker (org.apache.qpid.server.model.Broker)4 ConfiguredObjectFactoryImpl (org.apache.qpid.server.model.ConfiguredObjectFactoryImpl)4 JsonSystemConfigImpl (org.apache.qpid.server.model.JsonSystemConfigImpl)4 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)4 Principal (java.security.Principal)3 TaskExecutor (org.apache.qpid.server.configuration.updater.TaskExecutor)3 SystemConfig (org.apache.qpid.server.model.SystemConfig)3 AuthenticationProvider (org.apache.qpid.server.model.AuthenticationProvider)2 ConfiguredObjectFactory (org.apache.qpid.server.model.ConfiguredObjectFactory)2 Preference (org.apache.qpid.server.model.preferences.Preference)2 UserPreferencesImpl (org.apache.qpid.server.model.preferences.UserPreferencesImpl)2 AuthenticatedPrincipal (org.apache.qpid.server.security.auth.AuthenticatedPrincipal)2 GroupPrincipal (org.apache.qpid.server.security.group.GroupPrincipal)2 Subject (javax.security.auth.Subject)1 IllegalConfigurationException (org.apache.qpid.server.configuration.IllegalConfigurationException)1