Example usage for com.liferay.portal.kernel.interval IntervalActionProcessor INTERVAL_DEFAULT

List of usage examples for com.liferay.portal.kernel.interval IntervalActionProcessor INTERVAL_DEFAULT

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.interval IntervalActionProcessor INTERVAL_DEFAULT.

Prototype

int INTERVAL_DEFAULT

To view the source code for com.liferay.portal.kernel.interval IntervalActionProcessor INTERVAL_DEFAULT.

Click Source Link

Usage

From source file:com.liferay.document.library.service.test.DLFileEntryLocalServiceTest.java

License:Open Source License

@Test
public void testDeleteFileEntries() throws Exception {
    ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(_group.getGroupId(),
            TestPropsValues.getUserId());

    Folder folder = DLAppServiceUtil.addFolder(_group.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
            RandomTestUtil.randomString(), RandomTestUtil.randomString(), serviceContext);

    for (int i = 0; i < 20; i++) {
        FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(TestPropsValues.getUserId(),
                _group.getGroupId(), folder.getFolderId(), RandomTestUtil.randomString(),
                ContentTypes.TEXT_PLAIN, RandomTestUtil.randomBytes(TikaSafeRandomizerBumper.INSTANCE),
                serviceContext);//from w  w  w  . j a  va2s . co m

        LocalRepository localRepository = RepositoryProviderUtil
                .getFileEntryLocalRepository(fileEntry.getFileEntryId());

        DLTrashLocalServiceUtil.moveFileEntryToTrash(TestPropsValues.getUserId(),
                localRepository.getRepositoryId(), fileEntry.getFileEntryId());
    }

    for (int i = 0; i < IntervalActionProcessor.INTERVAL_DEFAULT; i++) {
        DLAppLocalServiceUtil.addFileEntry(TestPropsValues.getUserId(), _group.getGroupId(),
                folder.getFolderId(), RandomTestUtil.randomString(), ContentTypes.TEXT_PLAIN,
                RandomTestUtil.randomBytes(TikaSafeRandomizerBumper.INSTANCE), serviceContext);
    }

    DLFileEntryLocalServiceUtil.deleteFileEntries(_group.getGroupId(), folder.getFolderId(), false);

    int fileEntriesCount = DLFileEntryLocalServiceUtil.getFileEntriesCount(_group.getGroupId(),
            folder.getFolderId());

    Assert.assertEquals(20, fileEntriesCount);
}