Skip to content

Commit 0736ef0

Browse files
committed
OWLS-73234: Add a situational test case to demonstrate overriding managed-server1 property
1 parent 471824c commit 0736ef0

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

integration-tests/src/test/resources/sitconfig/java/SitConfigTests.java

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static void main(String args[]) throws Exception {
110110
test.verifyRestartMax(5);
111111
test.verifyT3ChannelPublicAddress(adminHost);
112112
test.verifyT3ChannelPublicPort(30091);
113-
test.verifyServer1MaxMessageSize(77777777);
113+
test.verifyMSSeverMaxMessageSize(77777777,"managed-server1");
114114
}
115115

116116
if (testName.equals("testCustomSitConfigOverridesForJdbc")) {
@@ -297,8 +297,15 @@ protected void verifyMaxMessageSize(int expectedValue) {
297297
: "Didn't get the expected value " + expectedValue + " for MaxMessageSize";
298298
}
299299

300-
protected void verifyServer1MaxMessageSize(int expectedValue) {
301-
String serverName = "managed-server1";
300+
/**
301+
* A utility method to check if the max-message-size in the ServerConfig tree of a managed server matches with the
302+
* expected value, a integer value set in the configuration override file config.xml. Uses Java
303+
* assertions to verify if both the values match.
304+
*
305+
* @param expectedValue - integer value to be checked in the max-message-size attribute in
306+
* EditMBean in ServerConfig tree
307+
*/
308+
protected void verifyMSSeverMaxMessageSize(int expectedValue,String serverName) {
302309

303310
try {
304311
EditServiceMBean editSvc = getEditService();
@@ -308,12 +315,12 @@ protected void verifyServer1MaxMessageSize(int expectedValue) {
308315

309316
ServerMBean serverMbean = editDomainMBean.lookupServer(serverName);
310317
int got = serverMbean.getMaxMessageSize();
311-
}
312-
catch (Exception e) {
313-
e.printStackTrace();
314-
}
315318
assert expectedValue == got
316319
: "Didn't get the expected value " + expectedValue + " for " + serverName + " MaxMessageSize";
320+
}
321+
catch (Exception e) {
322+
e.printStackTrace();
323+
}
317324
}
318325

319326
/**
@@ -369,6 +376,11 @@ private ServerMBean getServerMBean() {
369376
return serverMBean;
370377
}
371378

379+
/**
380+
* Looks up the EditServiceMBean from MBeanServerConnection.
381+
*
382+
* @return the EditServiceMBean reference
383+
*/
372384
//Get edit Service
373385
private EditServiceMBean getEditService() throws Exception {
374386
MBeanServerConnection msc = lookupMBeanServerConnection(adminHost, adminPort, adminUser, adminPassword, "weblogic.management.mbeanservers.edit");

0 commit comments

Comments
 (0)