Package mc.core.domain.base.aspect
Class AspectAttributeTest
java.lang.Object
mc.core.system.base.BaseBean
mc.core.system.base.BaseBeanTx
mc.core.system.test.TestBase
mc.core.domain.base.aspect.AspectAttributeTest
public class AspectAttributeTest
extends mc.core.system.test.TestBase
PORTABLE TEST!
onBeforeTest() creates in config:
- nodeHrc with one nodeType and internalDesc "NT_TEST"
- type attribute with single value, single locale text. internalDesc "ATT_SV_SL"
- type attribute with single value, multi locale text. internalDesc "ATT_SV_ML"
- type attribute with multi value, multi locale text. internalDesc "ATT_MV_ML"
- type attribute with multi value, multi locale text, multi territory. internalDesc "ATT_TERR_ML"
- type attribute with single value, single locale text, multi territory. internalDesc "ATT_TERR_SL"
- type attribute with multi value, single locale numeric. internalDesc "ATT_MV_NUM"
- enum type attribute with single locale independent value and 3 values ("KEY1" to "KEY3"). internalDesc "ATT_SV_ENUM"
- enum type attribute with single locale dependent value and 3 values ("KEY1 (Wert 1/value 1)" to "KEY3 (Wert 3/value 3)"). internalDesc "ATT_SV_ML_ENUM"
- enum type attribute, multivalue, locale independent with 4 values ("KEY1 (Wert 1/value 1)" to "KEY4 (Wert 4/value 4)"). internalDesc "ATT_MV_ENUM"
- object attribute with single value, multi locale text. internalDesc "OBJ_ATT_SV_ML"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoid1.voidsame test astestDeleteAttributeValue()but using DataValueTO-API.
1.voidvoidtests edit standard value directly through AttributeDOvoid1.void1.voidtest object attribute multi locale, multivalue: set 5 values in de, then remove all values -> one e2a should still exist.voidvoidvoidvoidtests setting removeEmptyValues
1.voidvoidvoidvoidenum attribute single value: set value usingDataValueHandler#setEnumValue(DataValueSet).voidvoidvoidvoidvoidsets a list of values that overwrites existing list of values in locale using dvh.setValues(..)voidvoidvoidvoidvoidvoidinserts 2 assets with same externalKey, one visible, the other with LifeCycleFlag DELETED.voidTests storing of DVPattern for the following cases: T mit dem Wert "A" TBT mit den Werten "A" und "B" TU mit den Werten "3" und irgendeiner Einheit TBTBU mit den Werten "3", "6.42" und irgendeiner EinheitvoidvoidTests storing and display of DVPattern for the following cases: N mit dem Wert "3.2 -> display should be 3,2 with locale de, 3.2 with locale en" N{.0} mit den Werten "3.2" und 17.5 -> display should be 3 and 18" N{1.2}BT mit den Werten "0.3 Prozent" und "243 A" -> display "0,30 Prozent" und "243,00 A" TN{3.0}BU mit den Werten "-", "3" und irgendeiner Einheit -> display "-003 cm" NBUBTBNBU mit derselben Einheit und mit verschiedenen EinheitenvoidTests storing and display of DVPattern for the following cases: N{.0}BS{-}BN{.0} mit den Werten "5 und 10.7"-> display should be 5 - 11" N{.0}BTBL{ActionContext.DELETE} mit den Werten "10, Texte -> display should be "10 Texte löschen"voidvoidvoidvoidvoidvoidvoidtype attribute multi value, multi locale, territory dependent, test using DataValueTO-API.
1.voidvoidTests setting multivalues using DataValueTO and overwriting existing values.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidMethods inherited from class mc.core.system.test.TestBase
afterTest, beforeTest
-
Constructor Details
-
AspectAttributeTest
public AspectAttributeTest()
-
-
Method Details
-
testDeleteAttributeValue
1. test with single value locale independent value: adds and removes value.
2. test with single value locale dependent values in de/en: removes only the en value.
3. also remove the value in de -> e2a should be deleted as well (type attributes).- Throws:
Exception
-
testDeleteAttributeValueDVTO
same test astestDeleteAttributeValue()but using DataValueTO-API.
1. test with single value locale independent value: adds and removes value.
2. test with single value locale dependent values in de/en: removes only the en value.- Throws:
Exception
-
testRemoveAttributeValues
- Throws:
Exception
-
testUpdateRemoveMultipleAttributeValues
- Throws:
Exception
-
testSetAttributeValueSingle
- Throws:
Exception
-
testSetAttributeValueSingleDVTO
- Throws:
Exception
-
testSetAttributeValueLocale
- Throws:
Exception
-
testCopyAttributeValueLocale
- Throws:
Exception
-
testSetAttributeValueLocaleDVTO
- Throws:
Exception
-
testSetAttributeValueLocaleDVTOTextValueTO
- Throws:
Exception
-
testSetAttributeValueTerr
- Throws:
Exception
-
testSetAttributeValueTerrDVTO
type attribute multi value, multi locale, territory dependent, test using DataValueTO-API.
1. for terr de set one value each in de and en: -> 1 e2a with terr de
2. for terr en set one value each in de and en: -> 2 e2as with terr de/en, each with values in de and en
3. create 2 DataValueTOs: first with e2a-Id of e2a for terr de -> overwrite the value in locale de. 2nd with terr de -> append new e2a with terr de and locale de. -> 3 e2as, 2 with terr de, 1 with terr en- Throws:
Exception
-
testSetAttributeValueMulti
sets a list of values that overwrites existing list of values in locale using dvh.setValues(..)- Throws:
Exception
-
testSetAttributeValueMulti_MCQA_287
- Throws:
Exception
-
testSetAttributeValueMultiAppend
- Throws:
Exception
-
testSetAttributeValueMultiDVTO
- Throws:
Exception
-
testSetMultivalues
Tests setting multivalues using DataValueTO and overwriting existing values. Tests with locale dependent text values, enum values. Asset values are tested in testSetMultiValuesAsset.- Throws:
Exception
-
testSetMultivaluesEnum
- Throws:
Exception
-
testDeleteAttributeValuesAll
- Throws:
Exception
-
testRemoveEmptyValues
tests setting removeEmptyValues
1. type attribute text multi value, multi locale: add 3 values in de and 4 values in en by usingAspectAttribute.DataValueHandler.setFromString(String, Locale). Overwrite the en values with null value with removeEmptyValues = true should result in removal of en-values
2. type attribute numeric float with 2 units, multivalue: add 2 values and then remove using setFromString.
3. enum type attribute single value: add one value using the key of a standardvalue in setFromString, remove same as above.- Throws:
Exception
-
testRemoveEmptyValuesWithMultivalueAppend
- Throws:
Exception
-
testSetAttributeValueEnumSV
enum attribute single value: set value usingDataValueHandler#setEnumValue(DataValueSet). Remove value usingand test- Throws:
Exception
-
testSetAttributeValueEnumSVDVTO
- Throws:
Exception
-
testObjectAttributes
1. Object attribute: test with single value locale dependent values in de/en: overwrites value in en, then removes both values -> e2a should still exist.- Throws:
Exception
-
testObjectAttributesValueMulti
test object attribute multi locale, multivalue: set 5 values in de, then remove all values -> one e2a should still exist. Then add 5 values again -> the remaining e2a should be reused resulting in 5 e2as in total.- Throws:
Exception
-
testObjectAttributesFromStringWithPrio
1. Object attribute: test with single value locale dependent values in de/en: overwrites value in en, then removes both values -> e2a should still exist.- Throws:
Exception
-
testSetAttributeValueParsed
- Throws:
Exception
-
testSetMultivaluesAppend
- Throws:
Exception
-
testStandardValues
- Throws:
Exception
-
testStandardValuesDVTO
- Throws:
Exception
-
testStandardValuesParsed
- Throws:
Exception
-
testEditStandardValue
tests edit standard value directly through AttributeDO- Throws:
Exception
-
testPresetValueSample
- Throws:
Exception
-
testPresetValueDefault
- Throws:
Exception
-
testSetAttributeValueNumeric
- Throws:
Exception
-
testSetAttributeValuePattern
Tests storing of DVPattern for the following cases:- T mit dem Wert "A"
- TBT mit den Werten "A" und "B"
- TU mit den Werten "3" und irgendeiner Einheit
- TBTBU mit den Werten "3", "6.42" und irgendeiner Einheit
- Throws:
Exception
-
testSetAttributeValuePatternBoundariesFromString
- Throws:
Exception
-
testSetAttributeValuePatternNumeric
Tests storing and display of DVPattern for the following cases:- N mit dem Wert "3.2 -> display should be 3,2 with locale de, 3.2 with locale en"
- N{.0} mit den Werten "3.2" und 17.5 -> display should be 3 and 18"
- N{1.2}BT mit den Werten "0.3 Prozent" und "243 A" -> display "0,30 Prozent" und "243,00 A"
- TN{3.0}BU mit den Werten "-", "3" und irgendeiner Einheit -> display "-003 cm"
- NBUBTBNBU mit derselben Einheit und mit verschiedenen Einheiten
- Throws:
Exception
-
testSetAttributeValuePatternStaticText
Tests storing and display of DVPattern for the following cases:- N{.0}BS{-}BN{.0} mit den Werten "5 und 10.7"-> display should be 5 - 11"
- N{.0}BTBL{ActionContext.DELETE} mit den Werten "10, Texte -> display should be "10 Texte löschen"
- Throws:
Exception
-
testSetAttributeValuePatternUnit
- Throws:
Exception
-
testSetAttributeValuePriceDVTO
- Throws:
Exception
-
testSetAttributeValuePrice
- Throws:
Exception
-
testSetAttributeValueParsedAsset
inserts 2 assets with same externalKey, one visible, the other with LifeCycleFlag DELETED. Uses the externalKey to set DVAsset-AttributeValue -> should work because Assets with invisible LifecycleFlag should be filtered by search- Throws:
Exception
-
testSetMultivaluesAsset
- Throws:
Exception
-
testSetMultivaluesAssetLocaleDependent
- Throws:
Exception
-
testRemoveMultivaluesAssetLocaleDependent
- Throws:
Exception
-
testSetSingleValuesAsset
- Throws:
Exception
-
testSetSingleValuesAssetLocaleDependent
- Throws:
Exception
-
testSetAttributeValueBoolean
- Throws:
Exception
-
testSetMultiIndexingValues
- Throws:
Exception
-
testCheckWrongKeyLocale
- Throws:
Exception
-