Search in sources :

Example 26 with ConfigurationImpl

use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project activemq-artemis by apache.

the class LDAPSecurityTest method setUp.

@Before
public void setUp() throws Exception {
    locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
    testDir = temporaryFolder.getRoot().getAbsolutePath();
    ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
    Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false));
    server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) ActiveMQJAASSecurityManager(org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) InVMConnectorFactory(org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl) Before(org.junit.Before)

Example 27 with ConfigurationImpl

use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project activemq-artemis by apache.

the class LegacyLDAPSecuritySettingPluginTest method setUp.

@Before
public void setUp() throws Exception {
    locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
    testDir = temporaryFolder.getRoot().getAbsolutePath();
    LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin().setInitialContextFactory("com.sun.jndi.ldap.LdapCtxFactory").setConnectionURL("ldap://localhost:1024").setConnectionUsername("uid=admin,ou=system").setConnectionPassword("secret").setConnectionProtocol("s").setAuthentication("simple");
    ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
    Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin);
    server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) ActiveMQJAASSecurityManager(org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) InVMConnectorFactory(org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl) LegacyLDAPSecuritySettingPlugin(org.apache.activemq.artemis.core.server.impl.LegacyLDAPSecuritySettingPlugin) Before(org.junit.Before)

Example 28 with ConfigurationImpl

use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project activemq-artemis by apache.

the class NettySecurityClientTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    ConfigurationImpl config = createBasicConfig().addAcceptorConfiguration(getNettyAcceptorTransportConfiguration(true));
    messagingService = createServer(false, config);
    messagingService.start();
    waitForServerToStart(messagingService);
}
Also used : ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl) Before(org.junit.Before)

Example 29 with ConfigurationImpl

use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project activemq-artemis by apache.

the class ActiveMQRAClusteredTestBase method createSecondaryDefaultConfig.

protected Configuration createSecondaryDefaultConfig(boolean secondary) throws Exception {
    HashMap<String, Object> invmMap = new HashMap<>();
    HashMap<String, Object> nettyMap = new HashMap<>();
    String primaryConnectorName = "invm2";
    String secondaryConnectorName = "invm";
    int index = 0;
    if (secondary) {
        invmMap.put(TransportConstants.SERVER_ID_PROP_NAME, "1");
        nettyMap.put("port", "5545");
        primaryConnectorName = "invm";
        secondaryConnectorName = "invm2";
        index = 1;
    }
    ConfigurationImpl configuration = createBasicConfig(index).setJMXManagementEnabled(false).clearAcceptorConfigurations().addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, invmMap)).addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, nettyMap)).addConnectorConfiguration(secondaryConnectorName, secondaryConnector).addConnectorConfiguration(primaryConnectorName, primaryConnector).addClusterConfiguration(ActiveMQTestBase.basicClusterConnectionConfig(secondaryConnectorName, primaryConnectorName).setReconnectAttempts(0));
    recreateDataDirectories(getTestDir(), index, false);
    return configuration;
}
Also used : HashMap(java.util.HashMap) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)

Example 30 with ConfigurationImpl

use of org.apache.activemq.artemis.core.config.impl.ConfigurationImpl in project activemq-artemis by apache.

the class JournalFileSizeTest method testIncorrectFileSizeHigher.

@Test
public void testIncorrectFileSizeHigher() {
    ConfigurationImpl config = new ConfigurationImpl();
    int origFileSize = config.getJournalFileSize();
    config.setJournalFileSize(origFileSize + (align / 2 + 1));
    JournalStorageManager manager = new JournalStorageManager(config, EmptyCriticalAnalyzer.getInstance(), new OrderedExecutorFactory(null), new OrderedExecutorFactory(null));
    int fileSize = manager.getMessageJournal().getFileSize();
    Assert.assertEquals(origFileSize + align, fileSize);
}
Also used : OrderedExecutorFactory(org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl) JournalStorageManager(org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager) Test(org.junit.Test)

Aggregations

ConfigurationImpl (org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)45 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)26 Configuration (org.apache.activemq.artemis.core.config.Configuration)21 AddressSettings (org.apache.activemq.artemis.core.settings.impl.AddressSettings)13 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)12 Before (org.junit.Before)12 HashMap (java.util.HashMap)11 ActiveMQJAASSecurityManager (org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager)7 File (java.io.File)5 JMSConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)5 HashSet (java.util.HashSet)4 InVMConnectorFactory (org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory)4 ClusterConnectionConfiguration (org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration)3 CoreQueueConfiguration (org.apache.activemq.artemis.core.config.CoreQueueConfiguration)3 JournalStorageManager (org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager)3 Role (org.apache.activemq.artemis.core.security.Role)3 OrderedExecutorFactory (org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory)3 Test (org.junit.Test)3 Set (java.util.Set)2 ActiveMQDefaultConfiguration (org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration)2