Skip to content

Commit a33c43e

Browse files
adding missing name token for flattened folder (#1230)
1 parent bba8664 commit a33c43e

File tree

1 file changed

+17
-11
lines changed
  • integration-tests/alias-test/verify/src/test/python/aliastest/verify

1 file changed

+17
-11
lines changed

integration-tests/alias-test/verify/src/test/python/aliastest/verify/verifier.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
ERROR_FLATTENED_MBEAN_HAS_ATTRIBUTES = 3005
7373
ERROR_CANNOT_TEST_MBEAN_CD = 3006
7474
ERROR_SINGLE_UNPREDICTABLE = 3007
75+
ERROR_FLATTENED_FOLDER_ERROR = 3008
7576

7677
ERROR_ATTRIBUTE_ALIAS_NOT_FOUND = 4000
7778
ERROR_ATTRIBUTE_ALIAS_NOT_FOUND_IS_READONLY = 4001
@@ -107,6 +108,7 @@
107108
ERROR_UNABLE_TO_VERIFY_MBEAN_FOLDER: 'Unable to generate information for MBean',
108109
ERROR_ALIAS_FOLDER_NOT_IN_WLST: 'Alias Folder not an mbean',
109110
ERROR_SINGLE_UNPREDICTABLE: 'Alias Folder not marked single unpredictable',
111+
ERROR_FLATTENED_FOLDER_ERROR: 'Alias Flattened Folder not found',
110112
ERROR_FLATTENED_MBEAN_HAS_ATTRIBUTES: 'Alias flattened Folder has attributes',
111113
ERROR_USING_REFERENCE_AS_FOLDER: 'Reference attribute used as folder mbean',
112114
ERROR_ATTRIBUTE_ALIAS_NOT_FOUND: 'Attribute not found',
@@ -583,17 +585,9 @@ def _is_generated_attribute_readonly(self, location, generated_attribute, genera
583585
read_type = generated_attribute_info[CMO_READ_TYPE]
584586
_logger.finer('Using CMO read type {0} for attribute {1} which is in GET required list',
585587
read_type, generated_attribute, class_name=CLASS_NAME, method_name=_method_name)
586-
# elif READ_TYPE in generated_attribute_info and CMO_READ_TYPE in generated_attribute_info:
587-
# if generated_attribute_info[READ_TYPE] == READ_ONLY or generated_attribute_info[CMO_READ_TYPE] == READ_ONLY:
588-
# read_type = READ_ONLY
589-
# else:
590-
# read_type = READ_WRITE
591-
# _logger.finer('Using both LSA read type {0} and CMO read type {1} for attribute {2}',
592-
# read_type, generated_attribute_info[CMO_READ_TYPE], generated_attribute,
593-
# class_name=CLASS_NAME, method_name=_method_name)
594588
elif READ_TYPE in generated_attribute_info:
595589
read_type = generated_attribute_info[READ_TYPE]
596-
_logger.finer('Using both LSA read type {0} for attribute {1}', read_type, generated_attribute,
590+
_logger.finer('Using read type {0} for attribute {1}', read_type, generated_attribute,
597591
class_name=CLASS_NAME, method_name=_method_name)
598592
else:
599593
read_type = generated_attribute_info[CMO_READ_TYPE]
@@ -986,20 +980,32 @@ def _check_single_folder(self, dictionary, location, is_flattened_folder):
986980
:param is_flattened_folder: if current mbean is a flattened and single folder
987981
:param location: current location context of mbean
988982
"""
983+
_method_name = '_check_single_folder'
984+
_logger.entering(location.get_folder_path(), is_flattened_folder,
985+
class_name=CLASS_NAME, method_name=_method_name)
986+
989987
if INSTANCE_TYPE in dictionary:
990988
instance_type = dictionary[INSTANCE_TYPE]
991989
is_multiple = self._alias_helper.supports_multiple_mbean_instances(location)
992990
if is_flattened_folder:
993991
is_multiple = False
992+
token_name = self._alias_helper.get_name_token(location)
993+
location.add_name_token(token_name, 'foo')
994994
if is_multiple:
995995
if instance_type != MULTIPLE:
996996
self._add_error(location, ERROR_SINGLE_UNPREDICTABLE)
997997
else:
998998
try:
999+
_logger.finer('Calling get_wlst_mbean_name() on location {0}', location.get_folder_path,
1000+
class_name=CLASS_NAME, method_name=_method_name)
9991001
token_name = self._alias_helper.get_wlst_mbean_name(location)
1000-
except AliasException:
1001-
self._add_error(location, ERROR_ATTRIBUTE_INVALID_VERSION)
1002+
except AliasException, e:
1003+
if is_flattened_folder:
1004+
self._add_error(location, ERROR_FLATTENED_FOLDER_ERROR, message=str(e))
1005+
else:
1006+
self._add_error(location, ERROR_ATTRIBUTE_INVALID_VERSION)
10021007
return
1008+
10031009
if instance_type == SINGLE_NO_NAME:
10041010
if token_name != 'NO_NAME_0':
10051011
self._add_error(location, ERROR_ATTRIBUTE_MUST_BE_NO_NAME)

0 commit comments

Comments
 (0)