Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Anda Laakso committed Aug 22, 2019
1 parent b5b9fb4 commit 4203bff
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
12 changes: 4 additions & 8 deletions HpToolsLauncher/Runners/AlmTestSetsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public ITDConnection2 TdConnectionOld
public string ApiKey { get; set; }



/// <summary>
/// constructor
/// </summary>
Expand Down Expand Up @@ -1199,7 +1200,6 @@ public override TestSuiteRunResults Run()
}
catch (Exception ex)
{
scheduler = null;
Console.WriteLine(ex.Message);
}

Expand Down Expand Up @@ -1250,7 +1250,6 @@ public override TestSuiteRunResults Run()
ConsoleWriter.WriteLine(string.Format(Resources.AlmRunnerProblemWithHost, ex.Message));
}

// ConsoleWriter.WriteLine(Resources.AlmRunnerNumTests + " " + tsList.Count);

//set test parameters
if (filteredTestList.Count > 0)
Expand Down Expand Up @@ -1337,9 +1336,9 @@ public override TestSuiteRunResults Run()
/// <param name="abortFilename"></param>
private void SetTestResults(ITSTest currentTest, IExecutionStatus executionStatus, ITestSet targetTestSet, TestRunResults activeTestDesc, TestSuiteRunResults runDesc, string testPath, string abortFilename)
{
if (currentTest == null) throw new ArgumentNullException("currentTest");
if (currentTest == null) throw new ArgumentNullException("Current test set is null.");

if (activeTestDesc == null) throw new ArgumentNullException("activeTestDesc");
if (activeTestDesc == null) throw new ArgumentNullException("The test run results are empty.");

// write the status for each test
for (var k = 1; k <= executionStatus.Count; ++k)
Expand Down Expand Up @@ -1472,10 +1471,7 @@ private TestRunResults UpdateTestStatus(TestSuiteRunResults runResults, ITestSet
IExecutionStatus executionStatus, Stopwatch sw,
ref ITSTest prevTest, ref ITSTest currentTest, string abortFilename)
{
// if (activeTestDesc == null) throw new ArgumentNullException(nameof(activeTestDesc));

// if (currentTest == null) throw new ArgumentNullException(nameof(currentTest));


var tsExecutionFinished = false;

while ((tsExecutionFinished == false) && (timeout == -1 || sw.Elapsed.TotalSeconds < timeout))
Expand Down
1 change: 0 additions & 1 deletion HpToolsLauncher/TestRunners/GuiTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ private GuiTestRunResult ExecuteQTPRun(TestRunResults testResults)
Type runResultsOptionstype = Type.GetTypeFromProgID("QuickTest.RunResultsOptions");
var options = (RunResultsOptions)Activator.CreateInstance(runResultsOptionstype);
options.ResultsLocation = testResults.ReportLocation;
// _qtpApplication.Options.Run.RunMode = _uftRunMode;
if (_uftRunMode != null)
{
_qtpApplication.Options.Run.RunMode = _uftRunMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ private Properties createProperties() {
EncryptionUtils.getSecretKey());
}catch (Exception e){
e.printStackTrace();

}

props.put("almPassword", encAlmPass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher,
// Get the URL to the Script used to run the test, which is bundled
// in the plugin
URL cmdExeUrl =
Hudson.getInstance().pluginManager.uberClassLoader.getResource(HP_TOOLS_LAUNCHER_EXE);
Jenkins.getInstanceOrNull().pluginManager.uberClassLoader.getResource(HP_TOOLS_LAUNCHER_EXE);
if (cmdExeUrl == null) {
listener.fatalError(HP_TOOLS_LAUNCHER_EXE + " not found in resources");
return;
Expand Down Expand Up @@ -256,8 +256,7 @@ public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher,
build.setResult(Result.FAILURE);
return;
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
logger.println("Exception: " + e1.getMessage());
}

out.println("Operation was aborted by user.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ private void setRunId(RunResponse runResponse) {
* Log report url
*/
private void logReportUrl(boolean isSucceeded, Args args) {
isSucceeded = true;
if (isSucceeded) {
_logger.log(String.format(
"%s run report for run id %s is at: %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@

table tr td div.help {
margin-left: 12px;
background: none !important;
border: none !important;
background: none;
border: none;
}

.help {
border: none;
background: none !important;
background-color: transparent !important;
background: none;
background-color: transparent;
}

table td .help {
background: none !important;
background: none;
}

table tr[nameref^="rowSetStart"] {
background: none !important;
background: none;
}

table tr[nameref^="cb31"] {
background-color: transparent !important;
background-color: transparent;
}

textarea.setting-input{
Expand Down

0 comments on commit 4203bff

Please sign in to comment.