Package org.openbravo.materialmgmt
Class ProductCharacteristicTestUtils
- java.lang.Object
-
- org.openbravo.materialmgmt.ProductCharacteristicTestUtils
-
public class ProductCharacteristicTestUtils extends Object
Test utilities to deal with relevant characteristics
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addRelevantCharacteristic(String searchKey, String name, String moduleId)
Adds a new relevant characteristic into the "Relevant Characteristics" list reference.static void
assignCharacteristicValueToProduct(String productId, String characteristicValueId)
Assigns aCharacteristicValue
to aProduct
static Characteristic
createCharacteristicLinkedToRelevant(String name, String relevantCharacteristic)
Creates a newCharacteristic
linked to the provided relevant characteristicstatic CharacteristicValue
createCharacteristicValue(String name, String code, String characteristicId)
Creates a newCharacteristicValue
for the givenCharacteristic
static Field
createPropertyField(String tabId, String propertyPath, String moduleId)
static void
reloadRelevantCharacteristicsCache()
Reloads the cache of relevant characteristic propertiesstatic void
unlinkRelevantCharacteristic(String characteristicId)
Unlinks the relevant characteristic assigned to theCharacteristic
whose ID is passed as parameter
-
-
-
Method Detail
-
addRelevantCharacteristic
public static void addRelevantCharacteristic(String searchKey, String name, String moduleId)
Adds a new relevant characteristic into the "Relevant Characteristics" list reference. Note that this method invokesOBDal.flush()
to ensure that the changes are visible into the current transaction.- Parameters:
searchKey
- The search key of the new relevant characteristicname
- The name of the new relevant characteristicmoduleId
- The ID of the module that the new relevant characteristic belongs to
-
createCharacteristicLinkedToRelevant
public static Characteristic createCharacteristicLinkedToRelevant(String name, String relevantCharacteristic)
Creates a newCharacteristic
linked to the provided relevant characteristic- Parameters:
name
- The name of the new characteristicrelevantCharacteristic
- The search key of the relevant characteristic- Returns:
- the new characteristic
-
createCharacteristicValue
public static CharacteristicValue createCharacteristicValue(String name, String code, String characteristicId)
Creates a newCharacteristicValue
for the givenCharacteristic
- Parameters:
name
- The name of the new characteristic valuecode
- The code of the new characteristic valuecharacteristicId
- The ID of the characteristic that the new value belongs to- Returns:
- the new characteristic value
-
assignCharacteristicValueToProduct
public static void assignCharacteristicValueToProduct(String productId, String characteristicValueId)
Assigns aCharacteristicValue
to aProduct
- Parameters:
productId
- The ID of the productcharacteristicValueId
- The ID of the characteristic value
-
unlinkRelevantCharacteristic
public static void unlinkRelevantCharacteristic(String characteristicId)
Unlinks the relevant characteristic assigned to theCharacteristic
whose ID is passed as parameter- Parameters:
characteristicId
- The ID of the characteristic
-
reloadRelevantCharacteristicsCache
public static void reloadRelevantCharacteristicsCache()
Reloads the cache of relevant characteristic properties
-
-