Example usage for com.liferay.portal.kernel.service ResourceActionLocalServiceUtil getResourceActionsCount

List of usage examples for com.liferay.portal.kernel.service ResourceActionLocalServiceUtil getResourceActionsCount

Introduction

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

Prototype

public static int getResourceActionsCount(String name) 

Source Link

Usage

From source file:com.liferay.asset.service.test.AssetVocabularyServiceTest.java

License:Open Source License

@Test
public void testDeleteVocabulary() throws Exception {
    int initialAssetCategoriesCount = searchCount();
    int initialResourcesActionsCount = ResourceActionLocalServiceUtil
            .getResourceActionsCount(AssetVocabulary.class.getName());

    AssetVocabulary vocabulary = AssetTestUtil.addVocabulary(_group.getGroupId());

    AssetCategory category = AssetTestUtil.addCategory(_group.getGroupId(), vocabulary.getVocabularyId());

    AssetTestUtil.addCategory(_group.getGroupId(), vocabulary.getVocabularyId(), category.getCategoryId());

    Assert.assertEquals(initialAssetCategoriesCount + 2, searchCount());

    AssetVocabularyLocalServiceUtil.deleteVocabulary(vocabulary.getVocabularyId());

    Assert.assertEquals(initialAssetCategoriesCount, searchCount());
    Assert.assertEquals(initialResourcesActionsCount,
            ResourceActionLocalServiceUtil.getResourceActionsCount(AssetVocabulary.class.getName()));
    Assert.assertNull(AssetCategoryLocalServiceUtil.fetchAssetCategory(category.getCategoryId()));
    Assert.assertNull(AssetVocabularyLocalServiceUtil.fetchAssetVocabulary(vocabulary.getVocabularyId()));
}