Skip to content

Commit

Permalink
[FIXED JENKINS-12023] Quality Center plugin fails when timeout is not…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
rseguy committed Dec 7, 2011
1 parent cc69102 commit f8a0435
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -73,6 +73,8 @@ public class QualityCenter extends Builder {
public final static String RUN_MODE_PLANNED_HOST = "RUN_PLANNED_HOST";
public final static String RUN_MODE_REMOTE = "RUN_REMOTE";
public final static String[] RUN_MODES = { RUN_MODE_PLANNED_HOST, RUN_MODE_REMOTE, RUN_MODE_LOCAL };

public final static int DEFAULT_TIMEOUT = 600;

/** Quality Center installation name. */
private final String qcClientInstallationName;
Expand All @@ -95,7 +97,7 @@ public class QualityCenter extends Builder {
/** The name of the report file. */
private final String qcTSLogFile;
/** Timeout */
private final String qcTimeOut;
private final int qcTimeOut;
/** The parsed name (env vars) of the report file. */
private String parsedQcTSLogFile;
private String runMode;
Expand All @@ -113,7 +115,7 @@ public QualityCenter(
String qcTSFolder,
String qcTSName,
String qcTSLogFile,
String qcTimeOut,
int qcTimeOut,
String runMode,
String runHost) {
this.qcClientInstallationName = qcClientInstallationName;
Expand All @@ -126,7 +128,12 @@ public QualityCenter(
this.qcTSFolder = qcTSFolder;
this.qcTSName = qcTSName;
this.qcTSLogFile = qcTSLogFile;
this.qcTimeOut = qcTimeOut;
if(qcTimeOut <= 0) {
this.qcTimeOut = DEFAULT_TIMEOUT;
}
else {
this.qcTimeOut = qcTimeOut;
}
if(Arrays.asList(RUN_MODES).contains(runMode)) {
this.runMode = runMode;
}
Expand Down Expand Up @@ -185,7 +192,7 @@ public String getQcTSName() {
return qcTSName;
}

public String getQcTimeOut() {
public int getQcTimeOut() {
return qcTimeOut;
}

Expand Down Expand Up @@ -346,7 +353,7 @@ private String runVBScript(String testSetName, AbstractBuild<?, ?> build, Launch
args.add(Util.replaceMacro(env.expand(this.qcLogin), varResolver));

// If no password, then replace by ""
if(!StringUtils.isBlank(this.qcPass)) {
if(StringUtils.isNotBlank(this.qcPass)) {
args.addMasked(Util.replaceMacro(env.expand(this.qcPass), varResolver));
}
else {
Expand Down

0 comments on commit f8a0435

Please sign in to comment.