Example usage for com.liferay.portal.kernel.service GroupLocalServiceUtil addRoleGroup

List of usage examples for com.liferay.portal.kernel.service GroupLocalServiceUtil addRoleGroup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service GroupLocalServiceUtil addRoleGroup.

Prototype

public static void addRoleGroup(long roleId, long groupId) 

Source Link

Usage

From source file:com.liferay.user.groups.admin.service.test.UserGroupLocalServiceTest.java

License:Open Source License

@Before
public void setUp() throws Exception {
    _role = RoleTestUtil.addRole(RoleConstants.TYPE_REGULAR);

    _companyId = _role.getCompanyId();//from  w w w . j  a  v a 2  s.  co m

    _count = UserGroupLocalServiceUtil.searchCount(_companyId, null, new LinkedHashMap<String, Object>());

    _userGroup1 = UserGroupTestUtil.addUserGroup();
    _userGroup2 = UserGroupTestUtil.addUserGroup();

    GroupLocalServiceUtil.addRoleGroup(_role.getRoleId(), _userGroup1.getGroupId());
}

From source file:com.liferay.user.groups.admin.web.internal.search.test.UserGroupIndexerTest.java

License:Open Source License

@Test
public void testSearchUserGroups() throws Exception {
    _role = RoleTestUtil.addRole(RoleConstants.TYPE_REGULAR);

    long companyId = _role.getCompanyId();

    int count = _userGroupLocalService.searchCount(companyId, null, new LinkedHashMap<String, Object>());

    UserGroup userGroup = addUserGroup();

    addUserGroup();//from w w w  .  j a  v a  2s  . c o m

    GroupLocalServiceUtil.addRoleGroup(_role.getRoleId(), userGroup.getGroupId());

    Hits hits = search(companyId);

    Assert.assertEquals(hits.toString(), count + 2, hits.getLength());
}