本文整理汇总了Java中gov.nih.nci.security.authorization.domainobjects.Group.setGroupName方法的典型用法代码示例。如果您正苦于以下问题:Java Group.setGroupName方法的具体用法?Java Group.setGroupName怎么用?Java Group.setGroupName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.security.authorization.domainobjects.Group
的用法示例。
在下文中一共展示了Group.setGroupName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
protected void setUp() {
group1 = new Group();
group1.setGroupId(new Long(1));
group1.setGroupName("Group1");
group1copy = new Group();
group1copy.setGroupId(new Long(1));
group1copy.setGroupName("Group1");
group1copy2 = new Group();
group1copy2.setGroupId(new Long(1));
group1copy2.setGroupName("Group1");
group2 = new Group();
group2.setGroupId(new Long(2));
group2.setGroupName("Group2");
group3 = new Group();
group3.setGroupId(new Long(3));
group3.setGroupName("Group3");
}
示例2: testModifyGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
private void testModifyGroup() throws CSTransactionException, CSObjectNotFoundException
{
Group tempGroup = new Group();
java.util.Date CurrentTime = new java.util.Date();
tempGroup = userProvisioningManager.getGroupById("4");
tempGroup.setGroupName(GroupStringArray[3][0] + "Modified");
tempGroup.setGroupDesc(GroupStringArray[3][1] + "Modified");
tempGroup.setUpdateDate(CurrentTime);
userProvisioningManager.modifyGroup(tempGroup);
tempGroup = userProvisioningManager.getGroupById("4");
assertEquals("\nmodifyGroup did not modify Group Name\n", GroupStringArray[3][0] + "Modified", tempGroup.getGroupName());
assertEquals("\nmodifyGroup did not modify Group Description\n", GroupStringArray[3][1] + "Modified", tempGroup.getGroupDesc());
}
示例3: testGroupCreate
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
public void testGroupCreate(){
//UserProvisioningManager upm = SecurityServiceProvider.getUserProvisioningManger("Security");
try{
for(int i=1;i<101;i++){
Group grp = new Group();
grp.setGroupName("Group_Name_"+i);
grp.setGroupDesc("Group_Desc_"+i);
upm.createGroup(grp);
}
}catch(Exception ex){
ex.printStackTrace();
}
}
示例4: testGetUsers
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
/**
* Test of getUsers method, of class SecurityUtils.
*/
@Test
public void testGetUsers() throws Exception {
final Group group = new Group();
group.setGroupName("testGroup");
group.setGroupDesc("some desc");
SecurityUtils.getAuthorizationManager().createGroup(group);
this.garbage.add(group);
final User u = new User();
u.setLastName("ll");
u.setFirstName("ff");
u.setLoginName("lll");
SecurityUtils.getAuthorizationManager().createUser(u);
this.garbage.add(u);
SecurityUtils.getAuthorizationManager().assignUsersToGroup(group.getGroupId().toString(),
new String[] { u.getUserId().toString() });
final Set<User> s = SecurityUtils.getUsers(group.getGroupId());
assertEquals(1L, s.size());
assertEquals(u.getUserId(), s.iterator().next().getUserId());
}
示例5: testRemoveGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
private void testRemoveGroup() throws CSTransactionException
{
try
{
for (int x = 0; x < NumberOfGroupsToTest; x++)
{
Group obj = new Group();
obj.setGroupName(GroupStringArray[x][0]);
SearchCriteria sc = new GroupSearchCriteria(obj);
List objList = userProvisioningManager.getObjects(sc);
userProvisioningManager.removeGroup(((Group) objList.get(0)).getGroupId().toString());
}
assertTrue(true);
}
catch (Exception e)
{
assertTrue(false);
}
}
示例6: setUp
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
securityManager = new SecurityManagerImpl();
securityManager.setAuthorizationManagerFactory(authManagerFactory);
authorizedStudyElementsGroup = new AuthorizedStudyElementsGroup();
authorizedStudyElementsGroup.setId(Long.valueOf(1));
authorizedStudyElementsGroup.setAuthorizedGroup(new Group());
studyConfiguration = new StudyConfiguration();
UserWorkspace workspace = new UserWorkspace();
studyConfiguration.setUserWorkspace(workspace);
workspace.setUsername("user");
Group group = new Group();
group.setGroupName("Authorized Group");;
group.setGroupDesc("This is an Authorized Group");
AuthorizedStudyElementsGroup authorizedGroup = new AuthorizedStudyElementsGroup();
authorizedGroup.setAuthorizedGroup(group);
studyConfiguration.getAuthorizedStudyElementsGroups().add(authorizedGroup);
}
示例7: create
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public CollaboratorGroup create(String name) throws CSTransactionException, CSObjectNotFoundException {
LogUtil.logSubsystemEntry(LOG, name);
final Group group = new Group();
group.setGroupName(name);
group.setGroupDesc("Collaborator Group");
SecurityUtils.createGroup(group);
final User user = CaArrayUsernameHolder.getCsmUser();
final CollaboratorGroup cg = new CollaboratorGroup(group, user);
this.collaboratorGroupDao.save(cg);
LogUtil.logSubsystemExit(LOG);
return cg;
}
示例8: testAssignUsersToGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testAssignUsersToGroup() throws Exception {
final Group group = new Group();
group.setGroupName("testGroup");
group.setGroupDesc("some desc");
SecurityUtils.createGroup(group);
this.garbage.add(group);
final User u = new User();
u.setLastName("ll");
u.setFirstName("ff");
u.setLoginName("lll");
SecurityUtils.getAuthorizationManager().createUser(u);
this.garbage.add(u);
final Long groupId = group.getGroupId();
final Set<Long> userIds = Collections.singleton(u.getUserId());
SecurityUtils.assignUsersToGroup(groupId, userIds);
this.tx.commit();
final Set<User> members = SecurityUtils.getAuthorizationManager().getUsers(group.getGroupId().toString());
assertEquals(1L, members.size());
assertEquals(u.getUserId(), members.iterator().next().getUserId());
}
示例9: testGetGroupById
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
private void testGetGroupById() throws CSObjectNotFoundException
{
Group tempGroup;
for (int x = 0; x < NumberOfGroupsToTest; x++)
{
Group obj = new Group();
obj.setGroupName(GroupStringArray[x][0]);
SearchCriteria sc = new GroupSearchCriteria(obj);
List objList = userProvisioningManager.getObjects(sc);
tempGroup = userProvisioningManager.getGroupById(((Group) objList.get(0)).getGroupId().toString());
assertEquals("\nIncorrect Group Name\n", GroupStringArray[x][0], tempGroup.getGroupName());
assertEquals("\nIncorrect Group Desc\n", GroupStringArray[x][1], tempGroup.getGroupDesc());
}
}
示例10: xtestModifyGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
private void xtestModifyGroup() throws CSTransactionException, CSObjectNotFoundException
{
Group tempGroup = new Group();
java.util.Date CurrentTime = new java.util.Date();
tempGroup = userProvisioningManager.getGroupById("4");
tempGroup.setGroupName(GroupStringArray[3][0] + "Modified");
tempGroup.setGroupDesc(GroupStringArray[3][1] + "Modified");
tempGroup.setUpdateDate(CurrentTime);
userProvisioningManager.modifyGroup(tempGroup);
tempGroup = userProvisioningManager.getGroupById("4");
assertEquals("\nmodifyGroup did not modify Group Name\n", GroupStringArray[3][0] + "Modified", tempGroup.getGroupName());
assertEquals("\nmodifyGroup did not modify Group Description\n", GroupStringArray[3][1] + "Modified", tempGroup.getGroupDesc());
}
示例11: testGetAuthorizedStudyElementsGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
@Test
public void testGetAuthorizedStudyElementsGroup() {
AuthorizedStudyElementsGroup authorizedStudyElementsGroup = new AuthorizedStudyElementsGroup();
String groupName = "Group 1";
String groupDescription = "This is a test group for unit test";
StudyConfiguration studyConfiguration = new StudyConfiguration();
Long studyConfigId = 12345L;
studyConfiguration.setId(studyConfigId);
Group group = new Group();
group.setGroupName(groupName);
group.setGroupDesc(groupDescription);
authorizedStudyElementsGroup.setAuthorizedGroup(group);
authorizedStudyElementsGroup.setStudyConfiguration(studyConfiguration);
assertEquals(groupName,authorizedStudyElementsGroup.getAuthorizedGroup().getGroupName());
assertEquals(groupDescription,authorizedStudyElementsGroup.getAuthorizedGroup().getGroupDesc());
assertEquals(studyConfigId,authorizedStudyElementsGroup.getStudyConfiguration().getId());
}
示例12: testRemoveUserFromGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
/**
* Test of removeUserFromGroup method, of class SecurityUtils.
*/
@SuppressWarnings("unchecked")
@Test
public void testRemoveUserFromGroup() throws Exception {
final Group group = new Group();
group.setGroupName("testGroup");
group.setGroupDesc("some desc");
SecurityUtils.getAuthorizationManager().createGroup(group);
this.garbage.add(group);
final User u = new User();
u.setLastName("ll");
u.setFirstName("ff");
u.setLoginName("lll");
SecurityUtils.getAuthorizationManager().createUser(u);
this.garbage.add(u);
SecurityUtils.getAuthorizationManager().assignUsersToGroup(group.getGroupId().toString(),
new String[] { u.getUserId().toString() });
Set<User> members = SecurityUtils.getAuthorizationManager().getUsers(group.getGroupId().toString());
assertEquals(1L, members.size());
SecurityUtils.removeUserFromGroup(group.getGroupId(), u.getUserId());
this.tx.commit();
members = SecurityUtils.getAuthorizationManager().getUsers(group.getGroupId().toString());
assertTrue(members.isEmpty());
}
示例13: testCreateGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
private void testCreateGroup() throws CSTransactionException
{
for (int x=0; x<NumberOfGroupsToTest; x++)
{
Group tempGroup = new Group();
java.util.Date CurrentTime = new java.util.Date();
tempGroup.setGroupName(GroupStringArray[x][0]);
tempGroup.setGroupDesc(GroupStringArray[x][1]);
tempGroup.setUpdateDate(CurrentTime);
userProvisioningManager.createGroup(tempGroup);
}
}
示例14: testFindGroupByName
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
/**
* Test of findGroupByName method, of class SecurityUtils.
*/
@Test
public void testFindGroupByName() throws Exception {
final Group group = new Group();
group.setGroupName("testGroup");
group.setGroupDesc("some desc");
SecurityUtils.getAuthorizationManager().createGroup(group);
this.garbage.add(group);
final Group g = SecurityUtils.findGroupByName(group.getGroupName());
assertEquals(group.getGroupId(), g.getGroupId());
}
示例15: createGroup
import gov.nih.nci.security.authorization.domainobjects.Group; //导入方法依赖的package包/类
/**
* Test method: void createPrivilege(Privilege)
*/
protected Group createGroup() throws CSTransactionException {
Group g = new Group();
g.setGroupDesc("Test Desc");
g.setGroupName("Test Name" + System.currentTimeMillis());
upm.createGroup(g);
System.out.println("Created group with ID: " + g.getGroupId());
return g;
}