Search in sources :

Example 1 with Rdn

use of org.apache.directory.shared.ldap.model.name.Rdn in project activemq-artemis by apache.

the class AbstractCachedLDAPAuthorizationMapLegacyTest method testRenamePermission.

@Test
public void testRenamePermission() throws Exception {
    map.query();
    // Test for a permission rename
    connection.delete(new Dn("cn=Read,cn=TEST.FOO," + getQueueBaseDn()));
    Thread.sleep(2000);
    Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 0, failedACLs.size());
    failedACLs = map.getWriteACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 2, failedACLs.size());
    connection.rename(new Dn("cn=Write,cn=TEST.FOO," + getQueueBaseDn()), new Rdn("cn=Read"));
    Thread.sleep(2000);
    failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 2, failedACLs.size());
    failedACLs = map.getWriteACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 0, failedACLs.size());
}
Also used : ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) Dn(org.apache.directory.shared.ldap.model.name.Dn) Rdn(org.apache.directory.shared.ldap.model.name.Rdn) Test(org.junit.Test)

Example 2 with Rdn

use of org.apache.directory.shared.ldap.model.name.Rdn in project activemq-artemis by apache.

the class AbstractCachedLDAPAuthorizationMapLegacyTest method testRenameDestination.

@Test
public void testRenameDestination() throws Exception {
    map.query();
    // Test for a destination rename
    Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 2, failedACLs.size());
    connection.rename(new Dn("cn=TEST.FOO," + getQueueBaseDn()), new Rdn("cn=TEST.BAR"));
    Thread.sleep(2000);
    failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 0, failedACLs.size());
    failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.BAR"));
    assertEquals("set size: " + failedACLs, 2, failedACLs.size());
}
Also used : ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) Dn(org.apache.directory.shared.ldap.model.name.Dn) Rdn(org.apache.directory.shared.ldap.model.name.Rdn) Test(org.junit.Test)

Aggregations

ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)2 Dn (org.apache.directory.shared.ldap.model.name.Dn)2 Rdn (org.apache.directory.shared.ldap.model.name.Rdn)2 Test (org.junit.Test)2