8000 Merge branch 'release/1.4.0' into main · utPLSQL/utPLSQL-dotnet-api@a2cae75 · GitHub
[go: up one dir, main page]

Skip to content

Commit a2cae75

Browse files
committed
Merge branch 'release/1.4.0' into main
2 parents 3cc391a + c16cce9 commit a2cae75

File tree

5 files changed

+38
-16
lines changed

5 files changed

+38
-16
lines changed

utPLSQL.Api/utPLSQL.Api.Test/RealTimeTestRunnerTest.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void TestRunTests()
1414
var testRunner = new RealTimeTestRunner();
1515
testRunner.Connect(username: "toscamtest", password: "toscamtest", database: "CA40");
1616

17-
testRunner.RunTests(paths: new List<string>() { "toscamtest" });
17+
testRunner.RunTests(paths: "toscamtest");
1818

1919
var events = new List<@event>();
2020
testRunner.ConsumeResult(@event =>
@@ -32,10 +32,8 @@ public void TestRunTestsWithCoverage()
3232
var testRunner = new RealTimeTestRunner();
3333
testRunner.Connect(username: "toscamtest", password: "toscamtest", database: "CA40");
3434

35-
testRunner.RunTestsWithCoverage(paths: new List<string>() { "toscamtest" },
36-
coverageSchemas: new List<string>() { "toscam" },
37-
includeObjects: new List<string>() { "pa_m720", "pa_m770" },
38-
excludeObjects: null);
35+
testRunner.RunTestsWithCoverage(path: "toscamtest", coverageSchema: "toscam",
36+
includeObjects: new List<string>() { "pa_m720", "pa_m770" });
3937

4038
var events = new List<@event>();
4139
testRunner.ConsumeResult(@event =>

utPLSQL.Api/utPLSQL.Api/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.3.0.0")]
36-
[assembly: AssemblyFileVersion("1.3.0.0")]
35+
[assembly: AssemblyVersion("1.4.0.0")]
36+
[assembly: AssemblyFileVersion("1.4.0.0")]

utPLSQL.Api/utPLSQL.Api/RealTimeTestRunner.cs

Lines changed: 14 additions & 4 deletions
83
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ namespace utPLSQL
1212
/// </summary>
1313
public class RealTimeTestRunner : TestRunner<@event>
1414
{
15-
public override void RunTests(List<string> paths)
15+
public override void RunTests(params string[] paths)
1616
{
17-
if (paths != null && paths.Count > 0)
17+
if (paths != null && paths.Length > 0)
1818
{
1919
realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
2020

@@ -23,17 +23,19 @@ public override void RunTests(List<string> paths)
2323
BEGIN
2424
l_reporter.set_reporter_id(:id);
2525
l_reporter.output_buffer.init();
26-
ut_runner.run(a_paths => ut_varchar2_list({ConvertToUtVarchar2List(paths)}),
26+
ut_runner.run(a_paths => ut_varchar2_list({ConvertToUtVarchar2List(new List<string>(paths))}),
2727
a_reporters => ut_reporters(l_reporter));
2828
END;";
2929

3030
var cmd = new OracleCommand(proc, produceConnection);
3131
cmd.Parameters.Add("id", OracleDbType.Varchar2, ParameterDirection.Input).Value = realtimeReporterId;
3232
cmd.ExecuteNonQuery();
33+
34+
cmd.Dispose();
3335
}
3436
}
3537

36-
public override void RunTestsWithCoverage(List<string> paths, List<string> coverageSchemas, List<string> includeObjects, List<string> excludeObjects)
38+
public override void RunTestsWithCoverage(List<string> paths, List<string> coverageSchemas = null, List<string> includeObjects = null, List<string> excludeObjects = null)
3739
{
3840
if (paths != null && paths.Count > 0)
67E6 3941
{
@@ -75,9 +77,16 @@ public override void RunTestsWithCoverage(List<string> paths, List<string> cover
7577
cmd.Parameters.Add("coverage_id", OracleDbType.Varchar2, ParameterDirection.Input).Value = coverageReporterId;
7678

7779
cmd.ExecuteNonQuery();
80+
81+
cmd.Dispose();
7882
}
7983
}
8084

85+
public override void RunTestsWithCoverage(string path, string coverageSchema = null, List<string> includeObjects = null, List<string> excludeObjects = null)
86+
{
87+
this.RunTestsWithCoverage(new List<string>() { path }, new List<string>() { coverageSchema }, includeObjects, excludeObjects);
88+
}
89+
8190
public override void ConsumeResult(Action<@event> action)
8291
{
92
var proc = @"DECLARE
@@ -106,6 +115,7 @@ public override void ConsumeResult(Action<@event> action)
106115
}
107116

108117
reader.Close();
118+
cmd.Dispose();
109119
}
110120
}
111121
}

utPLSQL.Api/utPLSQL.Api/TestRunner.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public abstract class TestRunner<T>
2020

2121
/// <summary>
2222
/// Connects to the database.
23-
/// The TestRunner uses two connections. One for executing the tests and one for consuming the reuslts
23+
/// The TestRunner uses two connections. One for executing the tests and one for consuming the results
2424
/// </summary>
2525
/// <param name="username">Database username</param>
2626
/// <param name="password">Database password</param>
@@ -53,16 +53,20 @@ public String GetVersion()
5353
var cmd = new OracleCommand("select ut.version() from dual", produceConnection);
5454
OracleDataReader reader = cmd.ExecuteReader();
5555
reader.Read();
56+
5657
var version = reader.GetString(0);
58+
5759
reader.Close();
60+
cmd.Dispose();
61+
5862
return version;
5963
}
6064

6165
/// <summary>
6266
/// Run tests
6367
/// </summary>
64-
/// <param name="paths">List of path expressions</param>
65-
public abstract void RunTests(List<string> paths);
68+
/// <param name="paths">Path expressions</param>
69+
public abstract void RunTests(params string[] paths);
6670

6771
/// <summary>
6872
/// Run tests with coveage
@@ -71,7 +75,16 @@ public String GetVersion()
7175
/// <param name="coverageSchemas">List of schemas to cover</param>
7276
/// <param name="includeObjects">List of objects to include</param>
7377
/// <param name="excludeObjects">List of objects to exclude</param>
74-
public abstract void RunTestsWithCoverage(List<string> paths, List<string> coverageSchemas, List<string> includeObjects, List<string> excludeObjects);
78+
public abstract void RunTestsWithCoverage(List<string> paths, List<string> coverageSchemas = null, List<string> includeObjects = null, List<string> excludeObjects = null);
79+
80+
/// <summary>
81+
/// Run tests with coveage
82+
/// </summary>
83+
/// <param name="paths">The path</param>
84+
/// <param name="coverageSchema">The schemas to cover</param>
85+
/// <param name="includeObjects">List of objects to include</param>
86+
/// <param name="excludeObjects">List of objects to exclude</param>
87+
public abstract void RunTestsWithCoverage(string path, string coverageSchema = null, List<string> includeObjects = null, List<string> excludeObjects = null);
7588

7689
/// <summary>
7790
/// Consumes the results and calls the callback action on each result
@@ -110,6 +123,7 @@ public string GetCoverageReport()
110123
}
111124

112125
reader.Close();
126+
cmd.Dispose();
113127

114128
return sb.ToString();
115129
}

utPLSQL.Api/utPLSQL.Api/utPLSQL.Api.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>utPLSQL.Api</id>
5-
<version>1.3.0</version>
5+
<version>1.4.0</version>
66
<title>utPLSQL API</title>
77
<authors>Simon Martinelli</authors>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>

0 commit comments

Comments
 (0)
0