Skip to content

Commit

Permalink
Added accounting information to functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
efhjnw0 committed Jun 4, 2019
1 parent 610ea54 commit c6ef390
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public class TotalTestCTBuilder extends Builder implements SimpleBuildStep {
*/
private String sourceFolder = DescriptorImpl.defaultSourceFolder;
private String reportFolder = DescriptorImpl.defaultReportFolder;
private String accountInfo = DescriptorImpl.defaultAccountInfo;


@DataBoundConstructor
Expand Down Expand Up @@ -169,6 +170,12 @@ public boolean getStopIfTestFailsOrThresholdReached() {
return stopIfTestFailsOrThresholdReached;
}

public String getAccountInfo()
{
return accountInfo;
}


@DataBoundSetter
public void setSourceFolder(String sourceFolder) {
this.sourceFolder = sourceFolder;
Expand Down Expand Up @@ -210,6 +217,12 @@ public void setStopIfTestFailsOrThresholdReached(boolean stopIfTestFailsOrThresh
this.stopIfTestFailsOrThresholdReached = stopIfTestFailsOrThresholdReached;
}

@DataBoundSetter
public void setAccountInfo(String accountInfo)
{
this.accountInfo = accountInfo;
}

@Override
public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener)
throws InterruptedException, IOException {
Expand Down Expand Up @@ -283,6 +296,8 @@ public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
public static final Boolean defaultStopIfTestFailsOrThresholdReached = true;
public static final Boolean defaultUploadToServer = false;
public static final Boolean defaultHaltAtFailure = false;
public static final String defaultAccountInfo = "";

/**
* Validates for the 'CcThreshhold' field
* @param value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ private void addArguments(final ArgumentListBuilder args, final TaskListener lis
if (!Strings.isNullOrEmpty(tttBuilder.getSonarVersion())) {
args.add("-v").add(tttBuilder.getSonarVersion());
}

if (!Strings.isNullOrEmpty(tttBuilder.getAccountInfo()))
{
args.add("-a").add(tttBuilder.getAccountInfo());
}

}

Expand Down Expand Up @@ -414,16 +419,17 @@ private String getCliFilePath(final Launcher launcher) {
}
return cliDirectoryName;
}
/**
*
* @param launcher
* @param listener
* @param remoteFileSeparator
* @param osFile
* @return
* @throws IOException
* @throws InterruptedException
*/

/**
*
* @param launcher
* @param listener
* @param remoteFileSeparator
* @param osFile
* @return
* @throws IOException
* @throws InterruptedException
*/
private FilePath getCliRemoteFilePath(final Launcher launcher, final TaskListener listener,
String remoteFileSeparator, String osFile) throws IOException, InterruptedException {
FilePath fRootPath = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
</f:entry>
<f:entry title="${%reportFolder}" field="reportFolder">
<f:textbox default="${descriptor.defaultReportFolder}"/>
</f:entry>
<f:entry title="${%accountInfo}" field="accountInfo">
<f:textbox default="${descriptor.defaultAccountInfo}"/>
</f:entry>
</f:advanced>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ haltAtFailureDescription=Should the execution terminated when the first test cas
ccThreshhold=Code coverage treshhold
sourceFolder=Source folder
reportFolder=Report folder
stopIfTestFailsOrThresholdReached=Stop if test fails or threshold is reached
stopIfTestFailsOrThresholdReached=Stop if test fails or threshold is reached
accountInfo=Job Accounting Information
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
Optional job account information.<br>
Use the accounting information field to enter an account number and any other accounting information that your installation requires.
</div>

0 comments on commit c6ef390

Please sign in to comment.