@@ -110,7 +110,7 @@ public static void main(String args[]) throws Exception {
110
110
test .verifyRestartMax (5 );
111
111
test .verifyT3ChannelPublicAddress (adminHost );
112
112
test .verifyT3ChannelPublicPort (30091 );
113
- test .verifyServer1MaxMessageSize (77777777 );
113
+ test .verifyMSSeverMaxMessageSize (77777777 , "managed-server1" );
114
114
}
115
115
116
116
if (testName .equals ("testCustomSitConfigOverridesForJdbc" )) {
@@ -297,8 +297,15 @@ protected void verifyMaxMessageSize(int expectedValue) {
297
297
: "Didn't get the expected value " + expectedValue + " for MaxMessageSize" ;
298
298
}
299
299
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 ) {
302
309
303
310
try {
304
311
EditServiceMBean editSvc = getEditService ();
@@ -308,12 +315,12 @@ protected void verifyServer1MaxMessageSize(int expectedValue) {
308
315
309
316
ServerMBean serverMbean = editDomainMBean .lookupServer (serverName );
310
317
int got = serverMbean .getMaxMessageSize ();
311
- }
312
- catch (Exception e ) {
313
- e .printStackTrace ();
314
- }
315
318
assert expectedValue == got
316
319
: "Didn't get the expected value " + expectedValue + " for " + serverName + " MaxMessageSize" ;
320
+ }
321
+ catch (Exception e ) {
322
+ e .printStackTrace ();
323
+ }
317
324
}
318
325
319
326
/**
@@ -369,6 +376,11 @@ private ServerMBean getServerMBean() {
369
376
return serverMBean ;
370
377
}
371
378
379
+ /**
380
+ * Looks up the EditServiceMBean from MBeanServerConnection.
381
+ *
382
+ * @return the EditServiceMBean reference
383
+ */
372
384
//Get edit Service
373
385
private EditServiceMBean getEditService () throws Exception {
374
386
MBeanServerConnection msc = lookupMBeanServerConnection (adminHost , adminPort , adminUser , adminPassword , "weblogic.management.mbeanservers.edit" );
0 commit comments