Skip to content

Commit f0809d5

Browse files
committed
Merge branch 'alias-test-jarray-list-3' into 'main'
Allow exceptions for list attributes that match jarray See merge request weblogic-cloud/weblogic-deploy-tooling!1594
2 parents a755f8b + 2f07fde commit f0809d5

File tree

1 file changed

+16
-4
lines changed
  • integration-tests/alias-test/verify/src/test/python/aliastest/verify

1 file changed

+16
-4
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, 2022, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2024, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import java.io.IOException as IOException
@@ -154,6 +154,15 @@
154154
MESSAGE = 'message'
155155
ATTRIBUTE = 'attribute'
156156

157+
LIST_TYPE_MATCH_EXCEPTIONS = [
158+
# despite WLS methods with String[] signatures, these 4 attributes have to be set as Jython arrays.
159+
# their alias type needs to be `list`, so they are exempted from the exact type match
160+
'/Server/SingleSignOnServices/ServiceProviderSingleLogoutRedirectUri',
161+
'/Server/SingleSignOnServices/ServiceProviderSingleLogoutRedirectURIs',
162+
'/ServerTemplate/SingleSignOnServices/ServiceProviderSingleLogoutRedirectUri',
163+
'/ServerTemplate/SingleSignOnServices/ServiceProviderSingleLogoutRedirectURIs'
164+
]
165+
157166
_logger = PlatformLogger('test.aliases.verify')
158167
CLASS_NAME = 'Verifier'
159168

@@ -1222,8 +1231,11 @@ def _check_complex_type(self, location, generated_attribute, generated_attr_info
12221231
self._alias_helper.get_wlst_read_type(location, model_name)):
12231232
valid = True
12241233
elif alias_type == alias_constants.LIST:
1225-
if _is_of_type_with_get_required(generated_attribute, alias_type, generated_attr_info,
1226-
get_required_attribute_list):
1234+
match_path = location.get_folder_path() + '/' + generated_attribute
1235+
if match_path in LIST_TYPE_MATCH_EXCEPTIONS:
1236+
valid = True
1237+
elif _is_of_type_with_get_required(generated_attribute, alias_type, generated_attr_info,
1238+
get_required_attribute_list):
12271239
valid = True
12281240
elif _is_of_type_with_lsa(generated_attribute, alias_type, generated_attr_info,
12291241
get_required_attribute_list):
@@ -1274,7 +1286,7 @@ def _is_valid_alias_property_type(self, location, attribute, attr_info, alias_ty
12741286
attr_type = _is_attribute_type_for_get_required(get_type, cmo_type)
12751287
if attr_type != alias_constants.PROPERTIES:
12761288
self._add_invalid_type_error(location, attribute, attr_type, alias_type,
1277-
'Alias has GET with wrong type')
1289+
get_required_attribute_list, 'Alias has GET with wrong type')
12781290
elif _is_any_string_type(attr_info) and self._alias_helper.get_wlst_read_type(location, model_name) == \
12791291
alias_constants.SEMI_COLON_DELIMITED_STRING:
12801292
_logger.finest('Attribute {0} is string type and WLST read type is a delimited string type', attribute,

0 commit comments

Comments
 (0)