public class UserAndGroupTest extends AbstractXregistryTestCase {
public void testAddUser() throws Exception{
GlobalContext globalContext = new GlobalContext(true);
XregistryImpl registry = new XregistryImpl(globalContext);
String user = "/C=US/O=National Center for Supercomputing Applications/CN=Hemapani Srinath Perera";
registry.createGroup(user, "group1", "group1");
registry.createGroup(user, "group2", "group1");
registry.createUser(user, "user1", "User1");
registry.createUser(user, "user2", "User1");
registry.createUser(user, "user3", "User1");
registry.addUsertoGroup(user, "group1", "user1");
registry.addUsertoGroup(user, "group1", "user2");
registry.addUsertoGroup(user, "group2", "user3");
//
//registry.addAGroupToGroup(user, "group1", "group2");
String[] data = registry.listGroups(user);
TestUtils.testCantainment(data, "group1");
TestUtils.testCantainment(data, "group2");
data = registry.listGroupsGivenAUser(user, "user1");
TestUtils.testCantainment(data, "group1");
// data = registry.listUsersGivenAGroup(user, "group1");
// TestUtils.testCantainment(data, "user1");
// TestUtils.testCantainment(data, "user2");
//
//
// registry.removeUserFromGroup(user, "group1", "user1");
// data = registry.listUsersGivenAGroup(user, "group1");
// TestUtils.testCantainment(data, "user2");
registry.deleteGroup(user, "group1");
data = registry.listGroups(user);
TestUtils.printList(data);
registry.deleteGroup(user, "group2");
registry.deleteUser(user, "user1");
registry.deleteUser(user, "user2");
registry.deleteUser(user, "user3");
// String groupName = "extreme";
//