Search in sources :

Example 6 with FileDeploymentManager

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

the class FileConfigurationTest method testBrokerPlugin.

@Test
public void testBrokerPlugin() throws Exception {
    FileConfiguration fc = new FileConfiguration();
    FileDeploymentManager deploymentManager = new FileDeploymentManager("brokerPlugin.xml");
    deploymentManager.addDeployable(fc);
    deploymentManager.readConfiguration();
    List<ActiveMQServerPlugin> brokerPlugins = fc.getBrokerPlugins();
    assertEquals(2, brokerPlugins.size());
    assertTrue(brokerPlugins.get(0) instanceof EmptyPlugin1);
    assertTrue(brokerPlugins.get(1) instanceof EmptyPlugin2);
}
Also used : ActiveMQServerPlugin(org.apache.activemq.artemis.core.server.plugin.ActiveMQServerPlugin) FileDeploymentManager(org.apache.activemq.artemis.core.config.FileDeploymentManager) Test(org.junit.Test)

Example 7 with FileDeploymentManager

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

the class DefaultsFileConfigurationTest method createConfiguration.

// Protected ---------------------------------------------------------------------------------------------
@Override
protected Configuration createConfiguration() throws Exception {
    FileConfiguration fc = new FileConfiguration();
    FileDeploymentManager deploymentManager = new FileDeploymentManager("ConfigurationTest-defaults.xml");
    deploymentManager.addDeployable(fc);
    deploymentManager.readConfiguration();
    return fc;
}
Also used : FileDeploymentManager(org.apache.activemq.artemis.core.config.FileDeploymentManager)

Example 8 with FileDeploymentManager

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

the class JMSServerStartStopTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    FileConfiguration fc = new FileConfiguration();
    FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
    FileDeploymentManager deploymentManager = new FileDeploymentManager("server-start-stop-config1.xml");
    deploymentManager.addDeployable(fc);
    deploymentManager.addDeployable(fileConfiguration);
    deploymentManager.readConfiguration();
    ActiveMQJAASSecurityManager sm = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration());
    ActiveMQServer server = addServer(new ActiveMQServerImpl(fc, sm));
    jmsServer = new JMSServerManagerImpl(server, fileConfiguration);
    jmsServer.setRegistry(null);
}
Also used : FileConfiguration(org.apache.activemq.artemis.core.config.impl.FileConfiguration) ActiveMQServer(org.apache.activemq.artemis.core.server.ActiveMQServer) FileJMSConfiguration(org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) ActiveMQJAASSecurityManager(org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager) InVMLoginModule(org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule) SecurityConfiguration(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration) FileDeploymentManager(org.apache.activemq.artemis.core.config.FileDeploymentManager) ActiveMQServerImpl(org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl) Before(org.junit.Before)

Example 9 with FileDeploymentManager

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

the class JMSServerConfigParserTest method testParsing.

// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@Test
public void testParsing() throws Exception {
    Configuration config = createDefaultInVMConfig().addConnectorConfiguration("netty", new TransportConfiguration());
    String conf = "activemq-jms-for-JMSServerDeployerTest.xml";
    FileJMSConfiguration jmsconfig = new FileJMSConfiguration();
    FileDeploymentManager deploymentManager = new FileDeploymentManager(conf);
    deploymentManager.addDeployable(jmsconfig);
    deploymentManager.readConfiguration();
    assertEquals(1, jmsconfig.getQueueConfigurations().size());
    JMSQueueConfiguration queueConfig = jmsconfig.getQueueConfigurations().get(0);
    assertEquals("fullConfigurationQueue", queueConfig.getName());
    assertEquals(1, jmsconfig.getTopicConfigurations().size());
    TopicConfiguration topicConfig = jmsconfig.getTopicConfigurations().get(0);
    assertEquals("fullConfigurationTopic", topicConfig.getName());
}
Also used : JMSQueueConfiguration(org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration) Configuration(org.apache.activemq.artemis.core.config.Configuration) JMSQueueConfiguration(org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration) TopicConfiguration(org.apache.activemq.artemis.jms.server.config.TopicConfiguration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) FileJMSConfiguration(org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration) FileJMSConfiguration(org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) TopicConfiguration(org.apache.activemq.artemis.jms.server.config.TopicConfiguration) FileDeploymentManager(org.apache.activemq.artemis.core.config.FileDeploymentManager) Test(org.junit.Test)

Example 10 with FileDeploymentManager

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

the class ConfigurationTest method getActiveMQServer.

protected ActiveMQServer getActiveMQServer(String brokerConfig) throws Exception {
    FileConfiguration fc = new FileConfiguration();
    FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();
    FileDeploymentManager deploymentManager = new FileDeploymentManager(brokerConfig);
    deploymentManager.addDeployable(fc);
    deploymentManager.addDeployable(fileConfiguration);
    deploymentManager.readConfiguration();
    ActiveMQJAASSecurityManager sm = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration());
    return addServer(new ActiveMQServerImpl(fc, sm));
}
Also used : FileConfiguration(org.apache.activemq.artemis.core.config.impl.FileConfiguration) FileJMSConfiguration(org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration) ActiveMQJAASSecurityManager(org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager) InVMLoginModule(org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule) SecurityConfiguration(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration) FileDeploymentManager(org.apache.activemq.artemis.core.config.FileDeploymentManager) ActiveMQServerImpl(org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl)

Aggregations

FileDeploymentManager (org.apache.activemq.artemis.core.config.FileDeploymentManager)25 FileConfiguration (org.apache.activemq.artemis.core.config.impl.FileConfiguration)12 Test (org.junit.Test)11 FileJMSConfiguration (org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration)8 File (java.io.File)5 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)5 ActiveMQServerImpl (org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl)5 ActiveMQJAASSecurityManager (org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager)5 SecurityConfiguration (org.apache.activemq.artemis.core.config.impl.SecurityConfiguration)3 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)3 JMSServerManagerImpl (org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl)3 InVMLoginModule (org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule)3 JndiBindingRegistry (org.apache.activemq.artemis.core.registry.JndiBindingRegistry)2 JMSQueueConfiguration (org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration)2 TopicConfiguration (org.apache.activemq.artemis.jms.server.config.TopicConfiguration)2 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1