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"
the type attributes and the attribute type for the object attribute must be configured for the node type. The DataType for ATT_MV_NUM must allow units and the ATT_MV_NUM must have kg and m as allowed units.
  • Constructor Details

    • AspectAttributeTest

      public AspectAttributeTest()
  • Method Details

    • testDeleteAttributeValue

      public void testDeleteAttributeValue() throws Exception
      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

      public void testDeleteAttributeValueDVTO() throws Exception
      same test as testDeleteAttributeValue() 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

      public void testRemoveAttributeValues() throws Exception
      Throws:
      Exception
    • testUpdateRemoveMultipleAttributeValues

      public void testUpdateRemoveMultipleAttributeValues() throws Exception
      Throws:
      Exception
    • testSetAttributeValueSingle

      public void testSetAttributeValueSingle() throws Exception
      Throws:
      Exception
    • testSetAttributeValueSingleDVTO

      public void testSetAttributeValueSingleDVTO() throws Exception
      Throws:
      Exception
    • testSetAttributeValueLocale

      public void testSetAttributeValueLocale() throws Exception
      Throws:
      Exception
    • testCopyAttributeValueLocale

      public void testCopyAttributeValueLocale() throws Exception
      Throws:
      Exception
    • testSetAttributeValueLocaleDVTO

      public void testSetAttributeValueLocaleDVTO() throws Exception
      Throws:
      Exception
    • testSetAttributeValueLocaleDVTOTextValueTO

      public void testSetAttributeValueLocaleDVTOTextValueTO() throws Exception
      Throws:
      Exception
    • testSetAttributeValueTerr

      public void testSetAttributeValueTerr() throws Exception
      Throws:
      Exception
    • testSetAttributeValueTerrDVTO

      public void testSetAttributeValueTerrDVTO() throws Exception
      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

      public void testSetAttributeValueMulti() throws Exception
      sets a list of values that overwrites existing list of values in locale using dvh.setValues(..)
      Throws:
      Exception
    • testSetAttributeValueMulti_MCQA_287

      public void testSetAttributeValueMulti_MCQA_287() throws Exception
      Throws:
      Exception
    • testSetAttributeValueMultiAppend

      public void testSetAttributeValueMultiAppend() throws Exception
      Throws:
      Exception
    • testSetAttributeValueMultiDVTO

      public void testSetAttributeValueMultiDVTO() throws Exception
      Throws:
      Exception
    • testSetMultivalues

      public void testSetMultivalues() throws Exception
      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

      public void testSetMultivaluesEnum() throws Exception
      Throws:
      Exception
    • testDeleteAttributeValuesAll

      public void testDeleteAttributeValuesAll() throws Exception
      Throws:
      Exception
    • testRemoveEmptyValues

      public void testRemoveEmptyValues() throws Exception
      tests setting removeEmptyValues
      1. type attribute text multi value, multi locale: add 3 values in de and 4 values in en by using AspectAttribute.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

      public void testRemoveEmptyValuesWithMultivalueAppend() throws Exception
      Throws:
      Exception
    • testSetAttributeValueEnumSV

      public void testSetAttributeValueEnumSV() throws Exception
      enum attribute single value: set value using DataValueHandler#setEnumValue(DataValueSet). Remove value using and test
      Throws:
      Exception
    • testSetAttributeValueEnumSVDVTO

      public void testSetAttributeValueEnumSVDVTO() throws Exception
      Throws:
      Exception
    • testObjectAttributes

      public void testObjectAttributes() throws Exception
      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

      public void testObjectAttributesValueMulti() throws Exception
      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

      public void testObjectAttributesFromStringWithPrio() throws Exception
      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

      public void testSetAttributeValueParsed() throws Exception
      Throws:
      Exception
    • testSetMultivaluesAppend

      public void testSetMultivaluesAppend() throws Exception
      Throws:
      Exception
    • testStandardValues

      public void testStandardValues() throws Exception
      Throws:
      Exception
    • testStandardValuesDVTO

      public void testStandardValuesDVTO() throws Exception
      Throws:
      Exception
    • testStandardValuesParsed

      public void testStandardValuesParsed() throws Exception
      Throws:
      Exception
    • testEditStandardValue

      public void testEditStandardValue() throws Exception
      tests edit standard value directly through AttributeDO
      Throws:
      Exception
    • testPresetValueSample

      public void testPresetValueSample() throws Exception
      Throws:
      Exception
    • testPresetValueDefault

      public void testPresetValueDefault() throws Exception
      Throws:
      Exception
    • testSetAttributeValueNumeric

      public void testSetAttributeValueNumeric() throws Exception
      Throws:
      Exception
    • testSetAttributeValuePattern

      public void testSetAttributeValuePattern() throws Exception
      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

        public void testSetAttributeValuePatternBoundariesFromString() throws Exception
        Throws:
        Exception
      • testSetAttributeValuePatternNumeric

        public void testSetAttributeValuePatternNumeric() throws Exception
        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

          public void testSetAttributeValuePatternStaticText() throws Exception
          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

            public void testSetAttributeValuePatternUnit() throws Exception
            Throws:
            Exception
          • testSetAttributeValuePriceDVTO

            public void testSetAttributeValuePriceDVTO() throws Exception
            Throws:
            Exception
          • testSetAttributeValuePrice

            public void testSetAttributeValuePrice() throws Exception
            Throws:
            Exception
          • testSetAttributeValueParsedAsset

            public void testSetAttributeValueParsedAsset() throws Exception
            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

            public void testSetMultivaluesAsset() throws Exception
            Throws:
            Exception
          • testSetMultivaluesAssetLocaleDependent

            public void testSetMultivaluesAssetLocaleDependent() throws Exception
            Throws:
            Exception
          • testRemoveMultivaluesAssetLocaleDependent

            public void testRemoveMultivaluesAssetLocaleDependent() throws Exception
            Throws:
            Exception
          • testSetSingleValuesAsset

            public void testSetSingleValuesAsset() throws Exception
            Throws:
            Exception
          • testSetSingleValuesAssetLocaleDependent

            public void testSetSingleValuesAssetLocaleDependent() throws Exception
            Throws:
            Exception
          • testSetAttributeValueBoolean

            public void testSetAttributeValueBoolean() throws Exception
            Throws:
            Exception
          • testSetMultiIndexingValues

            public void testSetMultiIndexingValues() throws Exception
            Throws:
            Exception
          • testCheckWrongKeyLocale

            public void testCheckWrongKeyLocale() throws Exception
            Throws:
            Exception