Example usage for com.liferay.portal.kernel.model Group isCompanyStagingGroup

List of usage examples for com.liferay.portal.kernel.model Group isCompanyStagingGroup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model Group isCompanyStagingGroup.

Prototype

public boolean isCompanyStagingGroup();

Source Link

Usage

From source file:com.liferay.site.service.persistence.test.GroupServiceTest.java

License:Open Source License

@Test
public void testAddCompanyStagingGroup() throws Exception {
    Group companyGroup = GroupLocalServiceUtil.getCompanyGroup(TestPropsValues.getCompanyId());

    ServiceContext serviceContext = new ServiceContext();

    serviceContext.setAttribute("staging", Boolean.TRUE);

    Group companyStagingGroup = GroupLocalServiceUtil.addGroup(TestPropsValues.getUserId(),
            GroupConstants.DEFAULT_PARENT_GROUP_ID, companyGroup.getClassName(), companyGroup.getClassPK(),
            companyGroup.getGroupId(), companyGroup.getNameMap(), companyGroup.getDescriptionMap(),
            companyGroup.getType(), companyGroup.isManualMembership(), companyGroup.getMembershipRestriction(),
            companyGroup.getFriendlyURL(), false, companyGroup.isActive(), serviceContext);

    try {/*from w  w w . jav a2s  .c  o  m*/
        Assert.assertTrue(companyStagingGroup.isCompanyStagingGroup());

        Assert.assertEquals(companyGroup.getGroupId(), companyStagingGroup.getLiveGroupId());
    } finally {
        GroupLocalServiceUtil.deleteGroup(companyStagingGroup);
    }
}