*/
public void testGetPermissions()
{
BasicHive hive = new BasicHive();
hive.addPermission(new EverybodyPrincipal(), new TestPermission("foobar"));
hive.addPermission(new SimplePrincipal("foo.bar"), new TestPermission("foobar"));
hive.addPermission(new EverybodyPrincipal(), new TestPermission("test", "read, write"));
assertEquals(Collections.EMPTY_SET, hive.getPermissions(new SimplePrincipal("foobar")));
Set<Permission> permissions = hive.getPermissions(new EverybodyPrincipal());
assertEquals(2, permissions.size());
assertTrue(permissions.contains(new TestPermission("foobar")));
assertTrue(permissions.contains(new TestPermission("test", "read, write")));
permissions = hive.getPermissions(new SimplePrincipal("foo.bar"));
assertEquals(1, permissions.size());
assertTrue(permissions.contains(new TestPermission("foobar")));
}