当前位置: 首页>>代码示例>>Java>>正文


Java Group.setGroupName方法代码示例

本文整理汇总了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");
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:22,代码来源:GroupTest.java

示例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());
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:19,代码来源:UserProvisioningManagerTest.java

示例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();
	}
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:17,代码来源:TestClient.java

示例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());
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:26,代码来源:SecurityUtilsTest.java

示例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);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:21,代码来源:RegressionTest.java

示例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);
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:21,代码来源:SecurityManagerImplTest.java

示例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;

}
 
开发者ID:NCIP,项目名称:caarray,代码行数:22,代码来源:PermissionsManagementServiceBean.java

示例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());
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:27,代码来源:SecurityUtilsTest.java

示例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());

	}
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:17,代码来源:RegressionTest.java

示例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());
}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:19,代码来源:UserProvisioningManagerTest.java

示例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());

}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:22,代码来源:AuthorizedStudyElementsGroupTest.java

示例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());
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:31,代码来源:SecurityUtilsTest.java

示例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);
	}

}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:16,代码来源:UserProvisioningManagerTest.java

示例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());
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:15,代码来源:SecurityUtilsTest.java

示例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;

}
 
开发者ID:NCIP,项目名称:common-security-module,代码行数:14,代码来源:AuthorizationDAOImplTest.java


注:本文中的gov.nih.nci.security.authorization.domainobjects.Group.setGroupName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。