Skip to content

Commit e936216

Browse files
Merge pull request #32771 from gauthamkrishnanibm/update-TCKRunner
Update TCKRunner
2 parents 91e045c + 48507df commit e936216

File tree

1 file changed

+54
-9
lines changed
  • dev/fattest.simplicity/src/componenttest/topology/utils/tck

1 file changed

+54
-9
lines changed

dev/fattest.simplicity/src/componenttest/topology/utils/tck/TCKRunner.java

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ public class TCKRunner {
8181

8282
private static final Class<TCKRunner> c = TCKRunner.class;
8383

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-
8984
private static final String RELATIVE_POM_FILE = "tck/pom.xml";
9085
private static final String RELATIVE_POM_FILE2 = "pom.xml";
9186

@@ -123,6 +118,12 @@ public class TCKRunner {
123118
private boolean isTestNG = false;
124119
private File tckRunnerDir = new File("publish/tckRunner").getAbsoluteFile();
125120
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);
126127

127128
/////////// Builder methods //////////////////
128129

@@ -255,6 +256,50 @@ public TCKRunner withLogging(Map<String, Level> logs) {
255256

256257
return this;
257258
}
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+
}
258303

259304
/////////// Run method //////////////////
260305

@@ -459,14 +504,14 @@ private List<String> getMvnCommandParams(String... commands) throws Exception {
459504
stringArrayList.add("-Dwlp=" + getWLPInstallRoot());
460505
stringArrayList.add("-Dtck_server=" + getServerName());
461506
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());
465510
stringArrayList.add("-Dtck_port=" + getPort());
466511
stringArrayList.add("-Dtck_port_secure=" + getPortSecure());
467512
stringArrayList.add("-DtargetDirectory=" + getTargetDir().getAbsolutePath());
468513
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());
470515

471516
stringArrayList.addAll(getJarCliProperties());
472517

0 commit comments

Comments
 (0)