Skip to content

Commit 3ddace5

Browse files
authored
Merge pull request #40 from oracle/Issue#36,37,38,39-Make-corrections-to-JSON-alias-files
Fixes to alias JSON files needed for Issue# 36, 37 and 38
2 parents 4b89350 + be34a23 commit 3ddace5

File tree

5 files changed

+165
-5
lines changed

5 files changed

+165
-5
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
CONNECTION_FACTORY = 'ConnectionFactory'
5353
CONTEXT_CASE = 'ContextCase'
5454
CONTEXT_REQUEST_CLASS = 'ContextRequestClass'
55+
CPU_UTILIZATION = 'CpuUtilization'
5556
CREATE_TABLE_DDL_FILE = 'CreateTableDDLFile'
5657
CREDENTIAL = 'Credential'
5758
CREDENTIAL_MAPPER = 'CredentialMapper'
@@ -82,6 +83,7 @@
8283
ERROR_DESTINATION = 'ErrorDestination'
8384
EXECUTE_QUEUE = 'ExecuteQueue'
8485
FAIR_SHARE_REQUEST_CLASS = 'FairShareRequestClass'
86+
FILE_OPEN = 'FileOpen'
8587
FILE_STORE = 'FileStore'
8688
FLOW_CONTROL_PARAMS = 'FlowControlParams'
8789
FOREIGN_CONNECTION_FACTORY = 'ForeignConnectionFactory'
@@ -95,6 +97,7 @@
9597
HARVESTED_TYPE = 'HarvestedType'
9698
HARVESTER = 'Harvester'
9799
HEAP_DUMP_ACTION = 'HeapDumpAction'
100+
HEAP_RETAINED = 'HeapRetained'
98101
IMAGE_NOTIFICATION = 'ImageNotification'
99102
INSTRUMENTATION = 'Instrumentation'
100103
IPLANET_AUTHENTICATOR = 'IPlanetAuthenticator'
@@ -223,6 +226,7 @@
223226
TOPOLOGY = 'topology'
224227
TRANSACTION_LOG_JDBC_STORE = 'TransactionLogJDBCStore'
225228
TRANSACTION_PARAMS = 'TransactionParams'
229+
TRIGGER = 'Trigger'
226230
UNIFORM_DISTRIBUTED_QUEUE = 'UniformDistributedQueue'
227231
UNIFORM_DISTRIBUTED_TOPIC = 'UniformDistributedTopic'
228232
UNIX_MACHINE = 'UnixMachine'

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
"version": "[12.2.1,)",
66
"child_folders_type": "multiple",
77
"folders": {
8+
"PartitionWorkManager": {
9+
"wlst_type": "PartitionWorkManager",
10+
"version": "[12.2.1,)",
11+
"child_folders_type": "multiple",
12+
"folders": {},
13+
"attributes": {
14+
"FairShare": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "FairShare", "wlst_path": "WP001", "value": { "default": 50 }, "wlst_type": "integer"} ],
15+
"MaxThreadsConstraint": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MaxThreadsConstraint", "wlst_path": "WP001", "value": { "default": -1 }, "wlst_type": "integer"} ],
16+
"MaxThreadsConstraintQueueSize": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MaxThreadsConstraintQueueSize", "wlst_path": "WP001", "value": { "default": 8192 }, "wlst_type": "integer"} ],
17+
"MinThreadsConstraintCap": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MinThreadsConstraintCap", "wlst_path": "WP001", "value": { "default": 0 }, "wlst_type": "integer"} ],
18+
"Notes": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": { "default": "None" }, "wlst_type": "string"} ],
19+
"SharedCapacityPercent": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "SharedCapacityPercent", "wlst_path": "WP001", "value": { "default": 100 }, "wlst_type": "integer"} ]
20+
},
21+
"wlst_attributes_path": "WP001",
22+
"wlst_paths": {
23+
"WP001": "/Partition${:s}/%PARTITION%/PartitionWorkManager/%PARTITIONWM%"
24+
}
25+
},
826
"CoherencePartitionCacheConfig": {
927
"wlst_type": "CoherencePartitionCacheConfig${:s}",
1028
"child_folders_type": "multiple",
@@ -398,7 +416,6 @@
398416
"WP001": "/Partition${:s}/%PARTITION%"
399417
},
400418
"contains": [
401-
"PartitionWorkManager",
402419
"ResourceGroup",
403420
"ResourceManager",
404421
"SelfTuning"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828
},
2929
"Trigger": {
30-
"wlst_type": "Trigger",
30+
"wlst_type": "Trigger${:s}",
3131
"version": "[12.2.1,)",
3232
"child_folders_type": "multiple",
3333
"folders": { },
@@ -57,7 +57,7 @@
5757
"default_name_value": "${NO_NAME_0:FileOpenResource}",
5858
"folders": {
5959
"Trigger": {
60-
"wlst_type": "Trigger",
60+
"wlst_type": "Trigger${:s}",
6161
"version": "[12.2.1,)",
6262
"child_folders_type": "multiple",
6363
"folders": { },
@@ -102,7 +102,7 @@
102102
}
103103
},
104104
"Trigger": {
105-
"wlst_type": "Trigger",
105+
"wlst_type": "Trigger${:s}",
106106
"version": "[12.2.1,)",
107107
"child_folders_type": "multiple",
108108
"folders": { },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"default_name_value": "${NO_NAME_0:%WLDFRESOURCE%}",
7878
"folders": {
7979
"HeapDumpAction": {
80-
"wlst_type": "HeapDumpAction",
80+
"wlst_type": "HeapDumpAction${:s}",
8181
"version": "[12.2.1.1,)",
8282
"child_folders_type": "multiple",
8383
"folders": {},

core/src/test/python/aliases_test.py

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,5 +957,144 @@ def _assertMapEqual(self, expected, testObject):
957957
self.assertEqual(expected.get(key), testObject.get(str(key).strip()))
958958
return
959959

960+
def testIssue36Fix(self):
961+
base_location = LocationContext().append_location(FOLDERS.RESOURCE_MANAGER)
962+
token = self.aliases.get_name_token(base_location)
963+
base_location.add_name_token(token, 'ResourceManager-0')
964+
965+
location = LocationContext(base_location).append_location(FOLDERS.CPU_UTILIZATION)
966+
token = self.aliases.get_name_token(location)
967+
location.add_name_token(token, 'CpuUtilization-0')
968+
location.append_location(FOLDERS.TRIGGER)
969+
token = self.aliases.get_name_token(location)
970+
location.add_name_token(token, 'Trigger-0')
971+
972+
expected = [FOLDERS.TRIGGER, '%ss' % FOLDERS.TRIGGER]
973+
974+
wlst_mbean_type = self.aliases.get_wlst_mbean_type(location)
975+
self.assertEqual(wlst_mbean_type, expected[0])
976+
977+
wlst_mbean_type = self.online_aliases.get_wlst_mbean_type(location)
978+
self.assertEqual(wlst_mbean_type, expected[1])
979+
980+
location = LocationContext(base_location).append_location(FOLDERS.FILE_OPEN)
981+
token = self.aliases.get_name_token(location)
982+
location.add_name_token(token, 'FileOpen-0')
983+
location.append_location(FOLDERS.TRIGGER)
984+
token = self.aliases.get_name_token(location)
985+
location.add_name_token(token, 'Trigger-0')
986+
987+
wlst_mbean_type = self.aliases.get_wlst_mbean_type(location)
988+
self.assertEqual(wlst_mbean_type, expected[0])
989+
990+
wlst_mbean_type = self.online_aliases.get_wlst_mbean_type(location)
991+
self.assertEqual(wlst_mbean_type, expected[1])
992+
993+
location = LocationContext(base_location).append_location(FOLDERS.HEAP_RETAINED)
994+
token = self.aliases.get_name_token(location)
995+
location.add_name_token(token, 'HeapRetained-0')
996+
location.append_location(FOLDERS.TRIGGER)
997+
token = self.aliases.get_name_token(location)
998+
location.add_name_token(token, 'Trigger-0')
999+
1000+
wlst_mbean_type = self.aliases.get_wlst_mbean_type(location)
1001+
self.assertEqual(wlst_mbean_type, expected[0])
1002+
1003+
wlst_mbean_type = self.online_aliases.get_wlst_mbean_type(location)
1004+
self.assertEqual(wlst_mbean_type, expected[1])
1005+
1006+
return
1007+
1008+
def testIssue37Fix(self):
1009+
location = LocationContext().append_location(FOLDERS.WLDF_SYSTEM_RESOURCE)
1010+
token = self.aliases.get_name_token(location)
1011+
location.add_name_token(token, 'WLDFSystemResource-0')
1012+
location.append_location(FOLDERS.WLDF_RESOURCE)
1013+
location.append_location(FOLDERS.WATCH_NOTIFICATION)
1014+
token = self.aliases.get_name_token(location)
1015+
location.add_name_token(token, 'WatchNotification-0')
1016+
location.append_location(FOLDERS.HEAP_DUMP_ACTION)
1017+
token = self.aliases.get_name_token(location)
1018+
location.add_name_token(token, 'HeapDumpAction-0')
1019+
1020+
wlst_mbean_type = self.aliases.get_wlst_mbean_type(location)
1021+
expected = FOLDERS.HEAP_DUMP_ACTION
1022+
self.assertEqual(wlst_mbean_type, expected)
1023+
1024+
wlst_mbean_type = self.online_aliases.get_wlst_mbean_type(location)
1025+
expected = '%ss' % FOLDERS.HEAP_DUMP_ACTION
1026+
self.assertEqual(wlst_mbean_type, expected)
1027+
1028+
return
1029+
1030+
def testIssue38Fix(self):
1031+
location = LocationContext().append_location(FOLDERS.PARTITION)
1032+
token = self.aliases.get_name_token(location)
1033+
location.add_name_token(token, 'Partition-0')
1034+
1035+
# Check offline value of wlst_mbean_type of FOLDERS.PARTITION
1036+
wlst_mbean_type = self.aliases.get_wlst_mbean_type(location)
1037+
expected = FOLDERS.PARTITION
1038+
self.assertEqual(wlst_mbean_type, expected)
1039+
1040+
# Check online value of wlst_mbean_type of FOLDERS.PARTITION.
1041+
# There should be an 's' on the end of FOLDERS.PARTITION
1042+
wlst_mbean_type = self.online_aliases.get_wlst_mbean_type(location)
1043+
expected = '%ss' % FOLDERS.PARTITION
1044+
self.assertEqual(wlst_mbean_type, expected)
1045+
1046+
# Add FOLDERS.PARTITION_WORK_MANAGER to the location
1047+
location.append_location(FOLDERS.PARTITION_WORK_MANAGER)
1048+
token = self.aliases.get_name_token(location)
1049+
location.add_name_token(token, 'PartitionWorkManager-0')
1050+
1051+
# Check offline value of wlst_mbean_type after adding
1052+
# FOLDERS.PARTITION_WORK_MANAGER to the location. There
1053+
# should not be an 's' on the end of FOLDERS.PARTITION_WORK_MANAGER
1054+
wlst_mbean_type = self.aliases.get_wlst_mbean_type(location)
1055+
expected = FOLDERS.PARTITION_WORK_MANAGER
1056+
self.assertEqual(wlst_mbean_type, expected)
1057+
1058+
# Check online value of wlst_mbean_type after adding
1059+
# FOLDERS.PARTITION_WORK_MANAGER to the location. It
1060+
# should be the same value as offline; no 's' on the
1061+
# end of FOLDERS.PARTITION_WORK_MANAGER
1062+
wlst_mbean_type = self.online_aliases.get_wlst_mbean_type(location)
1063+
self.assertEqual(wlst_mbean_type, expected)
1064+
1065+
# Check offline value of wlst_list_path after adding
1066+
# FOLDERS.PARTITION_WORK_MANAGER to the location. There
1067+
# should not be an 's' on the end of FOLDERS.PARTITION or
1068+
# FOLDERS.PARTITION_WORK_MANAGER
1069+
expected = [FOLDERS.PARTITION, 'Partition-0', FOLDERS.PARTITION_WORK_MANAGER]
1070+
wlst_list_path = self.aliases.get_wlst_list_path(location)
1071+
self.assertEqual(wlst_list_path, '/%s' % '/'.join(expected))
1072+
1073+
# Check online value of wlst_list_path after adding
1074+
# FOLDERS.PARTITION_WORK_MANAGER to the location. There
1075+
# should be an 's' on the end of FOLDERS.PARTITION, but
1076+
# not on the end of FOLDERS.PARTITION_WORK_MANAGER
1077+
expected = ['%ss' % FOLDERS.PARTITION, 'Partition-0', FOLDERS.PARTITION_WORK_MANAGER]
1078+
wlst_list_path = self.online_aliases.get_wlst_list_path(location)
1079+
self.assertEqual(wlst_list_path, '/%s' % '/'.join(expected))
1080+
1081+
# Check offline value of wlst_subfolders_path after adding
1082+
# FOLDERS.PARTITION_WORK_MANAGER to the location. There
1083+
# should be an 's' on the end of FOLDERS.PARTITION, but
1084+
# not on the end of FOLDERS.PARTITION_WORK_MANAGER
1085+
expected = [FOLDERS.PARTITION, 'Partition-0', FOLDERS.PARTITION_WORK_MANAGER, 'PartitionWorkManager-0']
1086+
wlst_subfolders_path = self.aliases.get_wlst_subfolders_path(location)
1087+
self.assertEqual(wlst_subfolders_path, '/%s' % '/'.join(expected))
1088+
1089+
# Check online value of wlst_subfolders_path after adding
1090+
# FOLDERS.PARTITION_WORK_MANAGER to the location. There
1091+
# should be an 's' on the end of FOLDERS.PARTITION, but
1092+
# not on the end of FOLDERS.PARTITION_WORK_MANAGER
1093+
expected = ['%ss' % FOLDERS.PARTITION, 'Partition-0', FOLDERS.PARTITION_WORK_MANAGER, 'PartitionWorkManager-0']
1094+
wlst_subfolders_path = self.online_aliases.get_wlst_subfolders_path(location)
1095+
self.assertEqual(wlst_subfolders_path, '/%s' % '/'.join(expected))
1096+
1097+
return
1098+
9601099
if __name__ == '__main__':
9611100
unittest.main()

0 commit comments

Comments
 (0)