Search in sources :

Example 1 with EmbeddedRestActiveMQJMS

use of org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQJMS in project activemq-artemis by apache.

the class EmbeddedTest method startEmbedded.

@BeforeClass
public static void startEmbedded() throws Exception {
    server = new EmbeddedRestActiveMQJMS(null);
    server.getManager().setConfigResourcePath("activemq-rest.xml");
    SecurityConfiguration securityConfiguration = new SecurityConfiguration();
    securityConfiguration.addUser("guest", "guest");
    securityConfiguration.addRole("guest", "guest");
    securityConfiguration.setDefaultUser("guest");
    ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), securityConfiguration);
    server.getEmbeddedJMS().setSecurityManager(securityManager);
    server.start();
    List<String> connectors = new ArrayList<>();
    connectors.add("in-vm");
    server.getEmbeddedJMS().getJMSServerManager().createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
}
Also used : ActiveMQJAASSecurityManager(org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager) ArrayList(java.util.ArrayList) InVMLoginModule(org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule) SecurityConfiguration(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration) EmbeddedRestActiveMQJMS(org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQJMS) BeforeClass(org.junit.BeforeClass)

Aggregations

ArrayList (java.util.ArrayList)1 SecurityConfiguration (org.apache.activemq.artemis.core.config.impl.SecurityConfiguration)1 EmbeddedRestActiveMQJMS (org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQJMS)1 ActiveMQJAASSecurityManager (org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager)1 InVMLoginModule (org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule)1 BeforeClass (org.junit.BeforeClass)1