Example usage for com.liferay.portal.service.test ServiceTestUtil THREAD_COUNT

List of usage examples for com.liferay.portal.service.test ServiceTestUtil THREAD_COUNT

Introduction

In this page you can find the example usage for com.liferay.portal.service.test ServiceTestUtil THREAD_COUNT.

Prototype

int THREAD_COUNT

To view the source code for com.liferay.portal.service.test ServiceTestUtil THREAD_COUNT.

Click Source Link

Usage

From source file:com.liferay.message.boards.service.test.MBMessageServiceTest.java

License:Open Source License

@Before
public void setUp() throws Exception {
    String name = "Test Category";
    String description = "This is a test category.";
    String displayStyle = MBCategoryConstants.DEFAULT_DISPLAY_STYLE;
    String emailAddress = null;/*from   ww  w  . jav  a 2 s  . c  o m*/
    String inProtocol = null;
    String inServerName = null;
    int inServerPort = 0;
    boolean inUseSSL = false;
    String inUserName = null;
    String inPassword = null;
    int inReadInterval = 0;
    String outEmailAddress = null;
    boolean outCustom = false;
    String outServerName = null;
    int outServerPort = 0;
    boolean outUseSSL = false;
    String outUserName = null;
    String outPassword = null;
    boolean allowAnonymous = false;
    boolean mailingListActive = false;

    _group = GroupTestUtil.addGroup();

    for (int i = 0; i < ServiceTestUtil.THREAD_COUNT; i++) {
        UserTestUtil.addUser(_group.getGroupId());
    }

    ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(_group.getGroupId());

    serviceContext.setGroupPermissions(new String[] { ActionKeys.ADD_MESSAGE, ActionKeys.VIEW });
    serviceContext.setGuestPermissions(new String[] { ActionKeys.ADD_MESSAGE, ActionKeys.VIEW });

    _category = MBCategoryServiceUtil.addCategory(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, name,
            description, displayStyle, emailAddress, inProtocol, inServerName, inServerPort, inUseSSL,
            inUserName, inPassword, inReadInterval, outEmailAddress, outCustom, outServerName, outServerPort,
            outUseSSL, outUserName, outPassword, allowAnonymous, mailingListActive, serviceContext);

    _userIds = UserLocalServiceUtil.getGroupUserIds(_group.getGroupId());
}