Class CPTestUtil
java.lang.Object
com.liferay.commerce.product.test.util.CPTestUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBaseCommerceCatalogCommercePriceList(long groupId, String currencyCode, String type, com.liferay.portal.kernel.service.ServiceContext serviceContext) static com.liferay.asset.kernel.model.AssetCategoryaddCategoryToCPDefinitions(long groupId, long... cpDefinitionIds) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinition(long groupId) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinition(long groupId, boolean ignoreSKUCombinations, boolean hasDefaultInstance, int workflowAction) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinition(long groupId, String productTypeName) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinition(long groupId, String productTypeName, boolean ignoreSKUCombinations, boolean hasDefaultInstance) static com.liferay.commerce.product.model.CPInstanceaddCPDefinitionCPInstance(long cpDefinitionId, Map<Long, List<Long>> cpDefinitionOptionRelIdCPDefinitionOptionValueRelIds) static com.liferay.commerce.product.model.CPInstanceaddCPDefinitionCPInstanceWithPrice(long cpDefinitionId, Map<Long, List<Long>> cpDefinitionOptionRelIdCPDefinitionOptionValueRelIds, BigDecimal price) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionFromCatalog(long groupId, String productTypeName, boolean ignoreSKUCombinations, boolean hasDefaultInstance) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionFromCatalog(long groupId, String productTypeName, Date displayDate, Date expirationDate, boolean ignoreSKUCombinations, boolean hasDefaultInstance, int status) static com.liferay.commerce.product.model.CPDefinitionOptionReladdCPDefinitionOptionRel(long groupId, long cpDefinitionId, boolean skuContributor, int cpDefinitionOptionValueRelsCount) static com.liferay.commerce.product.model.CPDefinitionOptionReladdCPDefinitionOptionRel(long groupId, long cpDefinitionId, long cpOptionId) static com.liferay.commerce.product.model.CPDefinitionOptionValueReladdCPDefinitionOptionValueRel(long cpDefinitionId, long cpOptionId, String key, String name, String priceType, boolean required, boolean skuContributor, com.liferay.portal.kernel.service.ServiceContext serviceContext) static com.liferay.commerce.product.model.CPDefinitionOptionValueReladdCPDefinitionOptionValueRelWithPrice(long groupId, long cpDefinitionId, long cpInstanceId, long cpOptionId, String priceType, BigDecimal price, BigDecimal quantity, boolean required, boolean skuContributor, com.liferay.portal.kernel.service.ServiceContext serviceContext) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionWithChildCPDefinitions(long groupId) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionWithChildCPDefinitions(long groupId, int priceableOptionsCount) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionWithChildCPDefinitions(long groupId, int priceableOptionsCount, String priceType) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionWithChildCPDefinitions(long groupId, String priceType) static com.liferay.commerce.product.model.CPDefinitionaddCPDefinitionWithPrice(long groupId, BigDecimal price) static com.liferay.commerce.product.model.CPInstancestatic com.liferay.commerce.product.model.CPInstanceaddCPInstance(long groupId) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceFromCatalog(long groupId) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceFromCatalog(long groupId, long[] assetCategoryIds) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceFromCatalog(long groupId, BigDecimal price) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceFromCatalog(long groupId, BigDecimal price, String sku) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceFromCatalogWithERC(long groupId, String externalReferenceCode, BigDecimal price, String sku) static com.liferay.commerce.product.model.CPInstanceUnitOfMeasureaddCPInstanceUnitOfMeasure(long groupId, long cpInstanceId, String key, BigDecimal incrementalOrderQuantity, String sku) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceWithRandomSku(long groupId) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceWithRandomSku(long groupId, BigDecimal price) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceWithRandomSkuFromCatalog(long groupId) static com.liferay.commerce.product.model.CPInstanceaddCPInstanceWithSku(long groupId) Deprecated.As of Cavanaugh (7.4.x), use addCPInstanceWithRandomSkustatic com.liferay.commerce.product.model.CPOptionaddCPOption(long groupId, boolean skuContributor) static List<com.liferay.commerce.product.model.CPDefinitionOptionRel>addCPOption(long groupId, long cpDefinitionId, int cpOptionsCount, int cpOptionValuesCount) static com.liferay.commerce.product.model.CPOptionaddCPOption(long groupId, String commerceOptionTypeKey, boolean skuContributor) static com.liferay.commerce.product.model.CPOptionCategoryaddCPOptionCategory(long groupId) static com.liferay.commerce.product.model.CPOptionValueaddCPOptionValue(com.liferay.commerce.product.model.CPOption cpOption) static com.liferay.commerce.product.model.CPOptionValueaddCPOptionValue(com.liferay.commerce.product.model.CPOption cpOption, String key) static com.liferay.commerce.product.model.CPSpecificationOptionaddCPSpecificationOption(long groupId) static voidbuildCPInstances(com.liferay.commerce.product.model.CPDefinition cpDefinition) static String[]static StringgetDefaultCommerceOptionTypeKey(boolean skuContributor) static com.liferay.commerce.product.model.CPDefinitionOptionValueRelgetRandomCPDefinitionOptionValueRel(long cpDefinitionId) static List<com.liferay.commerce.product.model.CPDefinitionOptionValueRel>getRandomCPDefinitionOptionValueRels(long cpDefinitionId) static com.liferay.portal.kernel.search.SearchContextgetSearchContext(String keywords, int status, com.liferay.portal.kernel.model.Group group) static com.liferay.commerce.product.model.CommerceCataloggetSystemCommerceCatalog(long companyId) static BigDecimalstripTrailingZeros(BigDecimal bigDecimal)
-
Constructor Details
-
CPTestUtil
public CPTestUtil()
-
-
Method Details
-
addBaseCommerceCatalogCommercePriceList
public static void addBaseCommerceCatalogCommercePriceList(long groupId, String currencyCode, String type, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCategoryToCPDefinitions
public static com.liferay.asset.kernel.model.AssetCategory addCategoryToCPDefinitions(long groupId, long... cpDefinitionIds) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinition
public static com.liferay.commerce.product.model.CPDefinition addCPDefinition(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinition
public static com.liferay.commerce.product.model.CPDefinition addCPDefinition(long groupId, boolean ignoreSKUCombinations, boolean hasDefaultInstance, int workflowAction) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinition
public static com.liferay.commerce.product.model.CPDefinition addCPDefinition(long groupId, String productTypeName) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinition
public static com.liferay.commerce.product.model.CPDefinition addCPDefinition(long groupId, String productTypeName, boolean ignoreSKUCombinations, boolean hasDefaultInstance) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionCPInstance
public static com.liferay.commerce.product.model.CPInstance addCPDefinitionCPInstance(long cpDefinitionId, Map<Long, List<Long>> cpDefinitionOptionRelIdCPDefinitionOptionValueRelIds) throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionCPInstanceWithPrice
public static com.liferay.commerce.product.model.CPInstance addCPDefinitionCPInstanceWithPrice(long cpDefinitionId, Map<Long, List<Long>> cpDefinitionOptionRelIdCPDefinitionOptionValueRelIds, BigDecimal price) throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionFromCatalog
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionFromCatalog(long groupId, String productTypeName, boolean ignoreSKUCombinations, boolean hasDefaultInstance) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionFromCatalog
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionFromCatalog(long groupId, String productTypeName, Date displayDate, Date expirationDate, boolean ignoreSKUCombinations, boolean hasDefaultInstance, int status) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionOptionRel
public static com.liferay.commerce.product.model.CPDefinitionOptionRel addCPDefinitionOptionRel(long groupId, long cpDefinitionId, boolean skuContributor, int cpDefinitionOptionValueRelsCount) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionOptionRel
public static com.liferay.commerce.product.model.CPDefinitionOptionRel addCPDefinitionOptionRel(long groupId, long cpDefinitionId, long cpOptionId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionOptionValueRel
public static com.liferay.commerce.product.model.CPDefinitionOptionValueRel addCPDefinitionOptionValueRel(long cpDefinitionId, long cpOptionId, String key, String name, String priceType, boolean required, boolean skuContributor, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionOptionValueRelWithPrice
public static com.liferay.commerce.product.model.CPDefinitionOptionValueRel addCPDefinitionOptionValueRelWithPrice(long groupId, long cpDefinitionId, long cpInstanceId, long cpOptionId, String priceType, BigDecimal price, BigDecimal quantity, boolean required, boolean skuContributor, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPDefinitionWithChildCPDefinitions
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionWithChildCPDefinitions(long groupId) throws Exception - Throws:
Exception
-
addCPDefinitionWithChildCPDefinitions
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionWithChildCPDefinitions(long groupId, int priceableOptionsCount) throws Exception - Throws:
Exception
-
addCPDefinitionWithChildCPDefinitions
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionWithChildCPDefinitions(long groupId, int priceableOptionsCount, String priceType) throws Exception - Throws:
Exception
-
addCPDefinitionWithChildCPDefinitions
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionWithChildCPDefinitions(long groupId, String priceType) throws Exception - Throws:
Exception
-
addCPDefinitionWithPrice
public static com.liferay.commerce.product.model.CPDefinition addCPDefinitionWithPrice(long groupId, BigDecimal price) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstance
public static com.liferay.commerce.product.model.CPInstance addCPInstance() throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstance
public static com.liferay.commerce.product.model.CPInstance addCPInstance(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceFromCatalog
public static com.liferay.commerce.product.model.CPInstance addCPInstanceFromCatalog(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceFromCatalog
public static com.liferay.commerce.product.model.CPInstance addCPInstanceFromCatalog(long groupId, BigDecimal price) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceFromCatalog
public static com.liferay.commerce.product.model.CPInstance addCPInstanceFromCatalog(long groupId, BigDecimal price, String sku) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceFromCatalog
public static com.liferay.commerce.product.model.CPInstance addCPInstanceFromCatalog(long groupId, long[] assetCategoryIds) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceFromCatalogWithERC
public static com.liferay.commerce.product.model.CPInstance addCPInstanceFromCatalogWithERC(long groupId, String externalReferenceCode, BigDecimal price, String sku) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceUnitOfMeasure
public static com.liferay.commerce.product.model.CPInstanceUnitOfMeasure addCPInstanceUnitOfMeasure(long groupId, long cpInstanceId, String key, BigDecimal incrementalOrderQuantity, String sku) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceWithRandomSku
public static com.liferay.commerce.product.model.CPInstance addCPInstanceWithRandomSku(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceWithRandomSku
public static com.liferay.commerce.product.model.CPInstance addCPInstanceWithRandomSku(long groupId, BigDecimal price) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceWithRandomSkuFromCatalog
public static com.liferay.commerce.product.model.CPInstance addCPInstanceWithRandomSkuFromCatalog(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPInstanceWithSku
@Deprecated public static com.liferay.commerce.product.model.CPInstance addCPInstanceWithSku(long groupId) throws com.liferay.portal.kernel.exception.PortalException Deprecated.As of Cavanaugh (7.4.x), use addCPInstanceWithRandomSku- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPOption
public static com.liferay.commerce.product.model.CPOption addCPOption(long groupId, boolean skuContributor) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPOption
public static List<com.liferay.commerce.product.model.CPDefinitionOptionRel> addCPOption(long groupId, long cpDefinitionId, int cpOptionsCount, int cpOptionValuesCount) throws Exception - Throws:
Exception
-
addCPOption
public static com.liferay.commerce.product.model.CPOption addCPOption(long groupId, String commerceOptionTypeKey, boolean skuContributor) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPOptionCategory
public static com.liferay.commerce.product.model.CPOptionCategory addCPOptionCategory(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPOptionValue
public static com.liferay.commerce.product.model.CPOptionValue addCPOptionValue(com.liferay.commerce.product.model.CPOption cpOption) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPOptionValue
public static com.liferay.commerce.product.model.CPOptionValue addCPOptionValue(com.liferay.commerce.product.model.CPOption cpOption, String key) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addCPSpecificationOption
public static com.liferay.commerce.product.model.CPSpecificationOption addCPSpecificationOption(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
buildCPInstances
public static void buildCPInstances(com.liferay.commerce.product.model.CPDefinition cpDefinition) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getCPOptionFieldTypes
public static String[] getCPOptionFieldTypes() throws com.liferay.portal.kernel.module.configuration.ConfigurationException- Throws:
com.liferay.portal.kernel.module.configuration.ConfigurationException
-
getDefaultCommerceOptionTypeKey
public static String getDefaultCommerceOptionTypeKey(boolean skuContributor) throws com.liferay.portal.kernel.module.configuration.ConfigurationException - Throws:
com.liferay.portal.kernel.module.configuration.ConfigurationException
-
getRandomCPDefinitionOptionValueRel
public static com.liferay.commerce.product.model.CPDefinitionOptionValueRel getRandomCPDefinitionOptionValueRel(long cpDefinitionId) -
getRandomCPDefinitionOptionValueRels
public static List<com.liferay.commerce.product.model.CPDefinitionOptionValueRel> getRandomCPDefinitionOptionValueRels(long cpDefinitionId) -
getSearchContext
public static com.liferay.portal.kernel.search.SearchContext getSearchContext(String keywords, int status, com.liferay.portal.kernel.model.Group group) -
getSystemCommerceCatalog
public static com.liferay.commerce.product.model.CommerceCatalog getSystemCommerceCatalog(long companyId) -
stripTrailingZeros
-