Skip to content

Commit 4aa42b9

Browse files
committed
Fix prepare model unit test to accept BooleanValue
1 parent 75bc825 commit 4aa42b9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

core/src/main/python/wlsdeploy/aliases/alias_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2022, 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 copy
@@ -52,6 +52,7 @@
5252
from wlsdeploy.aliases.alias_constants import WLST_TYPE
5353
from wlsdeploy.aliases.alias_constants import WLST_SUBFOLDERS_PATH
5454
from wlsdeploy.util import model_helper
55+
from wlsdeploy.util.boolean_value import BooleanValue
5556

5657
_class_name = 'alias_utils'
5758
_logger = PlatformLogger('wlsdeploy.aliases')
@@ -533,6 +534,8 @@ def convert_boolean(value):
533534
result = True
534535
elif value.lower() == 'false':
535536
result = False
537+
elif isinstance(value, BooleanValue):
538+
result = value.get_value()
536539
return result
537540

538541

core/src/test/python/wlsdeploy/tool/util/filters/wko_filter_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""
2-
Copyright (c) 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2021, 2022, 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 os
66

77
from base_test import BaseTestCase
8+
from wlsdeploy.aliases import alias_utils
89
from wlsdeploy.aliases.model_constants import APPLICATION
910
from wlsdeploy.aliases.model_constants import APP_DEPLOYMENTS
1011
from wlsdeploy.aliases.model_constants import AUTHENTICATION_PROVIDER
@@ -68,8 +69,10 @@ def testFilter(self):
6869

6970
# Dynamic clusters should have "CalculatedListenPorts" set to false
7071

71-
self._match(0, model, TOPOLOGY, CLUSTER, 'dynamicCluster', DYNAMIC_SERVERS, CALCULATED_LISTEN_PORTS)
72-
self._match(0, model, TOPOLOGY, CLUSTER, 'dynamicCluster2', DYNAMIC_SERVERS, CALCULATED_LISTEN_PORTS)
72+
for name in ['dynamicCluster', 'dynamicCluster2']:
73+
is_calc = self._traverse(model, TOPOLOGY, CLUSTER, name, DYNAMIC_SERVERS)[CALCULATED_LISTEN_PORTS]
74+
self.assertEqual(False, alias_utils.convert_boolean(is_calc),
75+
CALCULATED_LISTEN_PORTS + ' for ' + name + ' is ' + str(is_calc) + ', should be false')
7376

7477
# Online-only attributes should be removed from the model
7578

0 commit comments

Comments
 (0)