{
qsm.clearPerms();
HashSet<JndiPermission> expectedPerms = new HashSet<JndiPermission>();
// expected doOps() permissions
expectedPerms.add(new JndiPermission("path1", "createSubcontext"));
expectedPerms.add(new JndiPermission("path1", "lookup"));
expectedPerms.add(new JndiPermission("path1", "list"));
expectedPerms.add(new JndiPermission("path1", "listBindings"));
expectedPerms.add(new JndiPermission("path1/x", "bind"));
expectedPerms.add(new JndiPermission("path1/x", "rebind"));
expectedPerms.add(new JndiPermission("path1/x", "unbind"));
expectedPerms.add(new JndiPermission("path1", "unbind"));
SecurityUtil.doOps(ctx);
// expected doBadOps() permissions
expectedPerms.add(new JndiPermission("path2", "createSubcontext"));
expectedPerms.add(new JndiPermission("path1x", "createSubcontext"));
expectedPerms.add(new JndiPermission("path1x", "rebind"));
expectedPerms.add(new JndiPermission("path1x", "lookup"));
expectedPerms.add(new JndiPermission("path1x", "list"));
expectedPerms.add(new JndiPermission("path1x", "listBindings"));
expectedPerms.add(new JndiPermission("path1x/x", "bind"));
expectedPerms.add(new JndiPermission("path1x/x", "rebind"));
expectedPerms.add(new JndiPermission("path1x", "unbind"));
SecurityUtil.doBadOps(ctx, false);
List<Permission> perms = qsm.getPerms();
for(Permission p : perms)
{