Search in sources :

Example 1 with ModifyRequestImpl

use of org.apache.directory.shared.ldap.model.message.ModifyRequestImpl in project activemq-artemis by apache.

the class AbstractCachedLDAPAuthorizationMapLegacyTest method testChange.

@Test
public void testChange() throws Exception {
    map.query();
    // Change permission entry
    Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 2, failedACLs.size());
    Dn dn = new Dn("cn=read,cn=TEST.FOO," + getQueueBaseDn());
    ModifyRequest request = new ModifyRequestImpl();
    request.setName(dn);
    setupModifyRequest(request);
    connection.modify(request);
    Thread.sleep(2000);
    failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 1, failedACLs.size());
    // Change destination entry
    request = new ModifyRequestImpl();
    request.setName(new Dn("cn=TEST.FOO," + getQueueBaseDn()));
    request.add("description", "This is a description!  In fact, it is a very good description.");
    connection.modify(request);
    Thread.sleep(2000);
    failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
    assertEquals("set size: " + failedACLs, 1, failedACLs.size());
}
Also used : ModifyRequestImpl(org.apache.directory.shared.ldap.model.message.ModifyRequestImpl) ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) Dn(org.apache.directory.shared.ldap.model.name.Dn) ModifyRequest(org.apache.directory.shared.ldap.model.message.ModifyRequest) Test(org.junit.Test)

Aggregations

ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)1 ModifyRequest (org.apache.directory.shared.ldap.model.message.ModifyRequest)1 ModifyRequestImpl (org.apache.directory.shared.ldap.model.message.ModifyRequestImpl)1 Dn (org.apache.directory.shared.ldap.model.name.Dn)1 Test (org.junit.Test)1