Exemple #1
0
  public void testAddAndRemoveACL() {
    ACL acl1 = new ACLImpl("acl1");
    ACL acl2 = new ACLImpl("acl2");

    acp.addACL(acl1);
    assertEquals(1, acp.getACLs().length);
    assertEquals(acl1, acp.getACLs()[0]);

    acp.addACL(0, acl2);

    acp.removeACL("acl1");
    acp.removeACL("acl2");
    assertEquals(0, acp.getACLs().length);

    // Check that order doesn't matter
    acp.addACL(acl1);
    acp.addACL(acl2);
    acp.removeACL("acl1");
    acp.removeACL("acl2");
    assertEquals(0, acp.getACLs().length);

    acp.addACL(acl2);
    acp.addACL(acl1);
    acp.removeACL("acl1");
    acp.removeACL("acl2");
    assertEquals(0, acp.getACLs().length);

    assertNull(acp.removeACL("acl1"));
  }
Exemple #2
0
 public void testGetACLs() {
   ACL[] acls = acp.getACLs();
   assertEquals(0, acls.length);
 }