Example usage for com.liferay.portal.kernel.util LocaleUtil CHINA

List of usage examples for com.liferay.portal.kernel.util LocaleUtil CHINA

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util LocaleUtil CHINA.

Prototype

Locale CHINA

To view the source code for com.liferay.portal.kernel.util LocaleUtil CHINA.

Click Source Link

Usage

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

License:Open Source License

@Test
public void testGetSiteDefaultInheritLocaleWhenCompanyLocaleModified() throws Exception {

    Company company = CompanyLocalServiceUtil.getCompany(_group.getCompanyId());

    User defaultUser = company.getDefaultUser();

    String languageId = defaultUser.getLanguageId();

    try {//from  w  w  w  .j a  v  a  2 s .c o m
        defaultUser.setLanguageId(LanguageUtil.getLanguageId(LocaleUtil.CHINA));

        defaultUser = UserLocalServiceUtil.updateUser(defaultUser);

        Assert.assertEquals(LocaleUtil.CHINA, PortalUtil.getSiteDefaultLocale(_group.getGroupId()));
    } finally {
        defaultUser.setLanguageId(languageId);

        UserLocalServiceUtil.updateUser(defaultUser);
    }
}