use of org.apache.activemq.command.ActiveMQQueue in project activemq-artemis by apache.
the class AbstractCachedLDAPAuthorizationMapLegacyTest method testWildcards.
@Test
public void testWildcards() throws Exception {
map.query();
Set<?> fooACLs = map.getReadACLs(new ActiveMQQueue("FOO.1"));
assertEquals("set size: " + fooACLs, 2, fooACLs.size());
assertTrue("Contains admin group", fooACLs.contains(ADMINS));
assertTrue("Contains users group", fooACLs.contains(USERS));
Set<?> barACLs = map.getReadACLs(new ActiveMQQueue("BAR.2"));
assertEquals("set size: " + barACLs, 2, barACLs.size());
assertTrue("Contains admin group", barACLs.contains(ADMINS));
assertTrue("Contains users group", barACLs.contains(USERS));
}
use of org.apache.activemq.command.ActiveMQQueue in project activemq-artemis by apache.
the class AuthorizationMapTest method testWildcards.
public void testWildcards() {
AuthorizationMap map = createWildcardAuthorizationMap();
Set<?> readACLs = map.getReadACLs(new ActiveMQQueue("USERS.FOO.BAR"));
assertEquals("set size: " + readACLs, 1, readACLs.size());
assertTrue("Contains users group", readACLs.contains(ADMINS));
assertTrue("Contains users group", readACLs.contains(USERS));
Set<?> writeAcls = map.getWriteACLs(new ActiveMQQueue("USERS.FOO.BAR"));
assertEquals("set size: " + writeAcls, 1, writeAcls.size());
assertTrue("Contains users group", writeAcls.contains(ADMINS));
assertTrue("Contains users group", writeAcls.contains(USERS));
Set<?> adminAcls = map.getAdminACLs(new ActiveMQQueue("USERS.FOO.BAR"));
assertEquals("set size: " + adminAcls, 1, adminAcls.size());
assertTrue("Contains users group", adminAcls.contains(ADMINS));
assertFalse("Contains users group", adminAcls.contains(USERS));
Set<?> tempAdminACLs = map.getTempDestinationAdminACLs();
assertEquals("set size: " + tempAdminACLs, 1, tempAdminACLs.size());
assertTrue("Contains users group", tempAdminACLs.contains(TEMP_DESTINATION_ADMINS));
}
use of org.apache.activemq.command.ActiveMQQueue in project activemq-artemis by apache.
the class AuthorizationMapTest method testAuthorizationMapWithTempDest.
public void testAuthorizationMapWithTempDest() {
AuthorizationMap map = createAuthorizationMapWithTempDest();
Set<?> readACLs = map.getReadACLs(new ActiveMQQueue("USERS.FOO.BAR"));
assertEquals("set size: " + readACLs, 2, readACLs.size());
assertTrue("Contains users group", readACLs.contains(ADMINS));
assertTrue("Contains users group", readACLs.contains(USERS));
Set<?> tempAdminACLs = map.getTempDestinationAdminACLs();
assertEquals("set size: " + tempAdminACLs, 1, tempAdminACLs.size());
assertTrue("Contains users group", tempAdminACLs.contains(TEMP_DESTINATION_ADMINS));
}
use of org.apache.activemq.command.ActiveMQQueue in project activemq-artemis by apache.
the class JaasNetworkTest method testNetwork.
public void testNetwork() throws Exception {
System.setProperty("javax.net.ssl.trustStore", "src/test/resources/org/apache/activemq/security/client.ts");
System.setProperty("javax.net.ssl.trustStorePassword", "password");
System.setProperty("javax.net.ssl.trustStoreType", "jks");
System.setProperty("javax.net.ssl.keyStore", "src/test/resources/org/apache/activemq/security/client.ks");
System.setProperty("javax.net.ssl.keyStorePassword", "password");
System.setProperty("javax.net.ssl.keyStoreType", "jks");
ActiveMQConnectionFactory producerFactory = new ActiveMQConnectionFactory("ssl://localhost:61617");
Connection producerConn = producerFactory.createConnection();
Session producerSess = producerConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = producerSess.createProducer(new ActiveMQQueue("test"));
producerConn.start();
TextMessage sentMessage = producerSess.createTextMessage("test");
producer.send(sentMessage);
ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("ssl://localhost:61618");
Connection consumerConn = consumerFactory.createConnection();
Session consumerSess = consumerConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
consumerConn.start();
MessageConsumer consumer = consumerSess.createConsumer(new ActiveMQQueue("test"));
TextMessage receivedMessage = (TextMessage) consumer.receive(100);
assertEquals(sentMessage, receivedMessage);
}
use of org.apache.activemq.command.ActiveMQQueue in project activemq-artemis by apache.
the class LDAPAuthorizationMapTest method testComposite.
@Test
public void testComposite() {
ActiveMQDestination q1 = new ActiveMQQueue("queue1,topic://topic1");
Set<GroupPrincipal> aclsq1 = authMap.getWriteACLs(q1);
assertEquals(0, aclsq1.size());
}
Aggregations