Skip to content

Commit 8c5accb

Browse files
authored
Merge pull request #230 from oracle/WDT#218-discover-jta-path-service
Fix for JTA and PathService in JTA
2 parents 606894c + f6bd250 commit 8c5accb

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

core/src/main/python/wlsdeploy/tool/discover/common_resources_discoverer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
from java.io import File
@@ -58,6 +58,8 @@ def discover(self):
5858
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
5959
model_folder_name, folder_result = self.get_jdbc_stores()
6060
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
61+
model_folder_name, folder_result = self.get_path_services()
62+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
6163
JmsResourcesDiscoverer(self._model_context, self._dictionary, self._base_location, wlst_mode=self._wlst_mode,
6264
aliases=self._aliases).discover()
6365
model_folder_name, folder_result = self.get_wldf_system_resources()
@@ -289,7 +291,7 @@ def get_path_services(self):
289291
result[path_service] = OrderedDict()
290292
location.add_name_token(name_token, path_service)
291293
self._populate_model_parameters(result[path_service], location)
292-
location.remove_name_token(name_token.PATHSERVICE)
294+
location.remove_name_token(name_token)
293295
_logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
294296
return model_top_folder_name, result
295297

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
from java.io import File
@@ -306,9 +306,11 @@ def _get_jta(self):
306306
model_top_folder_name = model_constants.JTA
307307
result = OrderedDict()
308308
location = LocationContext(self._base_location)
309-
if self._subfolder_exists(model_top_folder_name, location):
309+
location.append_location(model_top_folder_name)
310+
name = self._find_singleton_name_in_folder(location)
311+
if name is not None:
310312
_logger.info('WLSDPLY-06614', class_name=_class_name, method_name=_method_name)
311-
location.append_location(model_top_folder_name)
313+
location.add_name_token(self._alias_helper.get_name_token(location), name)
312314
self._populate_model_parameters(result, location)
313315
_logger.exiting(class_name=_class_name, method_name=_method_name)
314316
return model_top_folder_name, result

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/JTA.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"copyright": "Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.",
2+
"copyright": "Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.",
33
"license": "The Universal Permissive License (UPL), Version 1.0",
44
"wlst_type": "JTA",
5+
"child_folders_type": "single_unpredictable",
6+
"default_name_value": "${NO_NAME_0:%DOMAIN%}",
57
"folders": {},
68
"attributes": {
79
"AbandonTimeoutSeconds": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "AbandonTimeoutSeconds", "wlst_path": "WP001", "value": {"default": 86400 }, "wlst_type": "integer" } ],
@@ -46,6 +48,6 @@
4648
},
4749
"wlst_attributes_path": "WP001",
4850
"wlst_paths": {
49-
"WP001": "/JTA/%DOMAIN%"
51+
"WP001": "/JTA/%JTA%"
5052
}
5153
}

core/src/test/python/aliases_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,15 @@ def testServerStartArgs(self):
13351335
existing_value)
13361336
self.assertEqual('-Dxyz=123,456,789', wlst_value)
13371337

1338+
def testGetJTA(self):
1339+
location = LocationContext()
1340+
location.append_location(FOLDERS.JTA)
1341+
location.add_name_token('DOMAIN', 'mydomain')
1342+
offline_path = self.aliases.get_wlst_mbean_name(location)
1343+
self.assertEqual('NO_NAME_0', offline_path)
1344+
online_path = self.online_aliases.get_wlst_mbean_name(location)
1345+
self.assertEqual('mydomain', online_path)
1346+
13381347

13391348
if __name__ == '__main__':
13401349
unittest.main()

0 commit comments

Comments
 (0)