@@ -81,11 +81,6 @@ public class TCKRunner {
81
81
82
82
private static final Class <TCKRunner > c = TCKRunner .class ;
83
83
84
- private static final String DEFAULT_FAILSAFE_UNDEPLOYMENT = "true" ;
85
- private static final String DEFAULT_APP_DEPLOY_TIMEOUT = "180" ;
86
- private static final String DEFAULT_APP_UNDEPLOY_TIMEOUT = "60" ;
87
- private static final int DEFAULT_MBEAN_TIMEOUT = 60000 ;
88
-
89
84
private static final String RELATIVE_POM_FILE = "tck/pom.xml" ;
90
85
private static final String RELATIVE_POM_FILE2 = "pom.xml" ;
91
86
@@ -123,6 +118,12 @@ public class TCKRunner {
123
118
private boolean isTestNG = false ;
124
119
private File tckRunnerDir = new File ("publish/tckRunner" ).getAbsoluteFile ();
125
120
private File loggingPropertiesFile = new File (tckRunnerDir , "logging.properties" );
121
+
122
+ // Default timeout and boolean settings
123
+ private Boolean failSafeUndeployment = Boolean .TRUE ;
124
+ private Duration appDeployTimeout = Duration .ofSeconds (180 );
125
+ private Duration appUndeployTimeout = Duration .ofSeconds (60 );
126
+ private Duration mbeanTimeout = Duration .ofSeconds (60 );
126
127
127
128
/////////// Builder methods //////////////////
128
129
@@ -255,6 +256,50 @@ public TCKRunner withLogging(Map<String, Level> logs) {
255
256
256
257
return this ;
257
258
}
259
+
260
+ /**
261
+ * @param failSafeUndeployment whether to use failsafe undeployment
262
+ * @return this TCKRunner
263
+ */
264
+ public TCKRunner withFailSafeUndeployment (Boolean failSafeUndeployment ) {
265
+ Objects .requireNonNull (failSafeUndeployment );
266
+
267
+ this .failSafeUndeployment = failSafeUndeployment ;
268
+ return this ;
269
+ }
270
+
271
+ /**
272
+ * @param appDeployTimeout the timeout for app deployment
273
+ * @return this TCKRunner
274
+ */
275
+ public TCKRunner withAppDeployTimeout (Duration appDeployTimeout ) {
276
+ Objects .requireNonNull (appDeployTimeout );
277
+
278
+ this .appDeployTimeout = appDeployTimeout ;
279
+ return this ;
280
+ }
281
+
282
+ /**
283
+ * @param appUndeployTimeout the timeout for app undeployment
284
+ * @return this TCKRunner
285
+ */
286
+ public TCKRunner withAppUndeployTimeout (Duration appUndeployTimeout ) {
287
+ Objects .requireNonNull (appUndeployTimeout );
288
+
289
+ this .appUndeployTimeout = appUndeployTimeout ;
290
+ return this ;
291
+ }
292
+
293
+ /**
294
+ * @param mbeanTimeout the timeout for MBean operations
295
+ * @return this TCKRunner
296
+ */
297
+ public TCKRunner withMBeanTimeout (Duration mbeanTimeout ) {
298
+ Objects .requireNonNull (mbeanTimeout );
299
+
300
+ this .mbeanTimeout = mbeanTimeout ;
301
+ return this ;
302
+ }
258
303
259
304
/////////// Run method //////////////////
260
305
@@ -459,14 +504,14 @@ private List<String> getMvnCommandParams(String... commands) throws Exception {
459
504
stringArrayList .add ("-Dwlp=" + getWLPInstallRoot ());
460
505
stringArrayList .add ("-Dtck_server=" + getServerName ());
461
506
stringArrayList .add ("-Dtck_hostname=" + getServerHostName ());
462
- stringArrayList .add ("-Dtck_failSafeUndeployment=" + DEFAULT_FAILSAFE_UNDEPLOYMENT );
463
- stringArrayList .add ("-Dtck_appDeployTimeout=" + DEFAULT_APP_DEPLOY_TIMEOUT );
464
- stringArrayList .add ("-Dtck_appUndeployTimeout=" + DEFAULT_APP_UNDEPLOY_TIMEOUT );
507
+ stringArrayList .add ("-Dtck_failSafeUndeployment=" + failSafeUndeployment . toString () );
508
+ stringArrayList .add ("-Dtck_appDeployTimeout=" + appDeployTimeout . getSeconds () );
509
+ stringArrayList .add ("-Dtck_appUndeployTimeout=" + appUndeployTimeout . getSeconds () );
465
510
stringArrayList .add ("-Dtck_port=" + getPort ());
466
511
stringArrayList .add ("-Dtck_port_secure=" + getPortSecure ());
467
512
stringArrayList .add ("-DtargetDirectory=" + getTargetDir ().getAbsolutePath ());
468
513
stringArrayList .add ("-DcomponentRootDir=" + getComponentRootDir ());
469
- stringArrayList .add ("-Dsun.rmi.transport.tcp.responseTimeout=" + DEFAULT_MBEAN_TIMEOUT );
514
+ stringArrayList .add ("-Dsun.rmi.transport.tcp.responseTimeout=" + mbeanTimeout . toMillis () );
470
515
471
516
stringArrayList .addAll (getJarCliProperties ());
472
517
0 commit comments