Skip to content

Commit 1c1493b

Browse files
committed
Updated to utPLSQL.Api 1.3.0
1 parent 3c338d0 commit 1c1493b

File tree

10 files changed

+64
-77
lines changed

10 files changed

+64
-77
lines changed

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
<Reference Include="System.Xml.Linq" />
106106
<Reference Include="Microsoft.CSharp" />
107107
<Reference Include="System.Xml" />
108-
<Reference Include="utPLSQL.Api, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
109-
<HintPath>..\packages\utPLSQL.Api.1.2.1\lib\net40\utPLSQL.Api.dll</HintPath>
108+
<Reference Include="utPLSQL.Api, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
109+
<HintPath>..\packages\utPLSQL.Api.1.3.0\lib\net40\utPLSQL.Api.dll</HintPath>
110110
</Reference>
111111
</ItemGroup>
112112
<ItemGroup>

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<package id="Oracle.ManagedDataAccess" version="19.10.0" targetFramework="net40" />
77
<package id="UnmanagedExports" version="1.2.7" targetFramework="net40" />
88
<package id="UnmanagedExports.Repack" version="1.0.4" targetFramework="net40" />
9-
<package id="utPLSQL.Api" version="1.2.1" targetFramework="net40" />
9+
<package id="utPLSQL.Api" version="1.3.0" targetFramework="net40" />
1010
</packages>

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI.Standalone/LoginForm.Designer.cs

+16-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI.Standalone/LoginForm.cs

+9
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,14 @@ private void BtnRunTests_Click(object sender, EventArgs e)
1818
var testRunnerWindow = new TestRunnerWindow(realTimeTestRunner, null);
1919
testRunnerWindow.RunTestsAsync("USER", null, txtUsername.Text, null, false);
2020
}
21+
22+
private void btnCodeCoverage_Click(object sender, EventArgs e)
23+
{
24+
var realTimeTestRunner = new RealTimeTestRunner();
25+
realTimeTestRunner.Connect(txtUsername.Text, txtPassword.Text, txtDatabase.Text);
26+
27+
var testRunnerWindow = new TestRunnerWindow(realTimeTestRunner, null);
28+
testRunnerWindow.RunTestsAsync("USER", null, txtUsername.Text, null, true);
29+
}
2130
}
2231
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Oracle.ManagedDataAccess" version="19.10.0" targetFramework="net40" />
4-
<package id="utPLSQL.Api" version="1.2.1" targetFramework="net40" />
4+
<package id="utPLSQL.Api" version="1.3.0" targetFramework="net40" />
55
</packages>

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI.Standalone/utPLSQL.UI.Standalone.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
<Reference Include="System.Drawing" />
4646
<Reference Include="System.Windows.Forms" />
4747
<Reference Include="System.Xml" />
48-
<Reference Include="utPLSQL.Api, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
49-
<HintPath>..\packages\utPLSQL.Api.1.2.1\lib\net40\utPLSQL.Api.dll</HintPath>
48+
<Reference Include="utPLSQL.Api, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
49+
<HintPath>..\packages\utPLSQL.Api.1.3.0\lib\net40\utPLSQL.Api.dll</HintPath>
5050
</Reference>
5151
</ItemGroup>
5252
<ItemGroup>

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/CodeCoverageReportDialog.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
using System.Windows.Forms;
1+
using System.Collections.Generic;
2+
using System.Windows.Forms;
23

34
namespace utPLSQL
45
{
56
public partial class CodeCoverageReportDialog : Form
67
{
7-
public CodeCoverageReportDialog(string path)
8+
public CodeCoverageReportDialog(List<string> paths)
89
{
910
InitializeComponent();
1011

11-
txtPaths.Text = path;
12+
txtPaths.Text = paths[0];
1213
}
1314

1415
public string GetSchemas()

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/TestRunnerWindow.cs

+26-62
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using FontAwesome.Sharp;
22
using System;
3+
using System.Collections.Generic;
34
using System.ComponentModel;
45
using System.Drawing;
56
using System.Globalization;
@@ -56,7 +57,7 @@ public void RunTestsAsync(string type, string owner, string name, string procedu
5657

5758
if (coverage)
5859
{
59-
var codeCoverageReportDialog = new CodeCoverageReportDialog(GetPath(convertToType(type), owner, name, procedure));
60+
var codeCoverageReportDialog = new CodeCoverageReportDialog(GetPath(type, owner, name, procedure));
6061
var dialogResult = codeCoverageReportDialog.ShowDialog();
6162
if (dialogResult == DialogResult.OK)
6263
{
@@ -90,19 +91,19 @@ public void RunTestsAsync(string type, string owner, string name, string procedu
9091

9192
private void RunTests(string type, string owner, string name, string procedure)
9293
{
93-
Task.Factory.StartNew(() => testRunner.RunTests(convertToType(type), owner, name, procedure));
94+
Task.Factory.StartNew(() => testRunner.RunTests(GetPath(type, owner, name, procedure)));
9495
Running = true;
9596
}
9697

9798

9899

99100
private void RunWithCoverage(string type, string owner, string name, string procedure, CodeCoverageReportDialog codeCoverageReportDialog)
100101
{
101-
var schemas = ConvertToVarcharList(codeCoverageReportDialog.GetSchemas());
102-
var includes = ConvertToVarcharList(codeCoverageReportDialog.GetIncludes());
103-
var excludes = ConvertToVarcharList(codeCoverageReportDialog.GetExcludes());
102+
var schemas = ConvertToList(codeCoverageReportDialog.GetSchemas());
103+
var includes = ConvertToList(codeCoverageReportDialog.GetIncludes());
104+
var excludes = ConvertToList(codeCoverageReportDialog.GetExcludes());
104105

105-
Task.Factory.StartNew(() => testRunner.RunTestsWithCoverage(convertToType(type), owner, name, procedure, schemas, includes, excludes));
106+
Task.Factory.StartNew(() => testRunner.RunTestsWithCoverage(GetPath(type, owner, name, procedure), schemas, includes, excludes));
106107
Running = true;
107108
}
108109

@@ -208,7 +209,7 @@ private void CollectReport()
208209
});
209210
}
210211

211-
private string ConvertToVarcharList(string listValue)
212+
private List<string> ConvertToList(string listValue)
212213
{
213214
if (string.IsNullOrWhiteSpace(listValue))
214215
{
@@ -219,51 +220,29 @@ private string ConvertToVarcharList(string listValue)
219220
if (listValue.Contains(" "))
220221
{
221222
var parts = listValue.Split(' ');
222-
return JoinParts(parts);
223+
return new List<string>(parts);
223224
}
224225
else if (listValue.Contains(","))
225226
{
226227
var parts = listValue.Split(',');
227-
return JoinParts(parts);
228+
return new List<string>(parts);
228229
}
229230
else if (listValue.Contains("\n"))
230231
{
231232
var parts = listValue.Split('\n');
232-
return JoinParts(parts);
233+
return new List<string>(parts);
233234
}
234235
else
235236
{
236-
return $"'{listValue}'";
237+
return new List<string>() { listValue };
237238
}
238239
}
239240
}
240241

241-
private static string JoinParts(string[] parts)
242-
{
243-
var sb = new StringBuilder();
244-
var first = true;
245-
foreach (var part in parts)
246-
{
247-
if (!string.IsNullOrEmpty(part))
248-
{
249-
if (!first)
250-
{
251-
sb.Append(",");
252-
}
253-
254-
sb.Append("'").Append(part).Append("'");
255-
256-
first = false;
257-
}
258-
}
259-
260-
return sb.ToString();
261-
}
262-
263242
/*
264-
* Workaround for the progressbar animation that produces lagging
265-
* https://stackoverflow.com/questions/5332616/disabling-net-progressbar-animation-when-changing-value
266-
*/
243+
* Workaround for the progressbar animation that produces lagging
244+
* https://stackoverflow.com/questions/5332616/disabling-net-progressbar-animation-when-changing-value
245+
*/
267246
private void UpdateProgressBar(int completedTests)
268247
{
269248
int newValue = completedTests * Steps + 1;
@@ -284,25 +263,23 @@ private void SetWindowTitle(string type, string owner, string name, string proce
284263
{
285264
var startTime = DateTime.Now.ToString(CultureInfo.CurrentCulture);
286265
txtStart.Text = startTime;
287-
var path = GetPath(convertToType(type), owner, name, procedure);
288-
txtPath.Text = path;
266+
var path = GetPath(type, owner, name, procedure);
267+
txtPath.Text = path[0];
289268
this.Text = $"{path} {startTime}";
290269
}
291270

292-
private string GetPath(Type type, string owner, string name, string procedure)
271+
private List<string> GetPath(string type, string owner, string name, string procedure)
293272
{
294273
switch (type)
295274
{
296-
case Type.User:
297-
return name;
298-
case Type.Package:
299-
return $"{owner}.{name}";
300-
case Type.Procedure:
301-
return $"{owner}.{name}.{procedure}";
302-
case Type.All:
303-
return owner;
275+
case "USER":
276+
return new List<string>() { name };
277+
case "PACKAGE":
278+
return new List<string>() { $"{owner}.{name}" };
279+
case "PROCEDURE":
280+
return new List<string>() { $"{owner}.{name}.{procedure}" };
304281
default:
305-
return "";
282+
return new List<string>() { owner };
306283
}
307284
}
308285

@@ -453,20 +430,7 @@ private void CreateTestResults(test test)
453430
});
454431
}
455432
}
456-
private Type convertToType(string type)
457-
{
458-
switch (type)
459-
{
460-
case "USER":
461-
return Type.User;
462-
case "PACKAGE":
463-
return Type.Package;
464-
case "PROCEDURE":
465-
return Type.Procedure;
466-
default:
467-
return Type.All;
468-
}
469-
}
433+
470434
private void btnClose_Click(object sender, System.EventArgs e)
471435
{
472436
Close();

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<packages>
33
<package id="FontAwesome.Sharp" version="5.15.3" targetFramework="net40" />
44
<package id="Oracle.ManagedDataAccess" version="19.10.0" targetFramework="net40" />
5-
<package id="utPLSQL.Api" version="1.2.1" targetFramework="net40" />
5+
<package id="utPLSQL.Api" version="1.3.0" targetFramework="net40" />
66
</packages>

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/utPLSQL.UI.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
<Reference Include="Microsoft.CSharp" />
4747
<Reference Include="System.Data" />
4848
<Reference Include="System.Xml" />
49-
<Reference Include="utPLSQL.Api, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\utPLSQL.Api.1.2.1\lib\net40\utPLSQL.Api.dll</HintPath>
49+
<Reference Include="utPLSQL.Api, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
50+
<HintPath>..\packages\utPLSQL.Api.1.3.0\lib\net40\utPLSQL.Api.dll</HintPath>
5151
</Reference>
5252
</ItemGroup>
5353
<ItemGroup>

0 commit comments

Comments
 (0)