Skip to content

Commit 46c977d

Browse files
committed
Code restructuring and first funcional version with RealTimeTestRunner
1 parent 269310d commit 46c977d

32 files changed

+1471
-304
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PlsqlDeveloperUtPlsqlPlugin/.vs
2-
PlsqlDeveloperUtPlsqlPlugin/packages
3-
PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/bin
4-
PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/obj
1+
**/.vs
2+
**/packages
3+
**/**/bin
4+
**/**/obj

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.sln

+20
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ VisualStudioVersion = 16.0.30804.86
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlsqlDeveloperUtPlsqlPlugin", "PlsqlDeveloperUtPlsqlPlugin\PlsqlDeveloperUtPlsqlPlugin.csproj", "{0241FA41-E396-491A-B4EC-772B694EC689}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "utPLSQL.Lib.Test", "utPLSQL.Lib.Test\utPLSQL.Lib.Test.csproj", "{8E898B26-0A4C-4DDA-9820-D5D050D2336E}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "utPLSQL.Lib", "utPLSQL.Lib\utPLSQL.Lib.csproj", "{DF09EACE-50EC-44EA-849A-80462A219CFC}"
11+
EndProject
812
Global
913
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1014
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +25,22 @@ Global
2125
{0241FA41-E396-491A-B4EC-772B694EC689}.Release|Any CPU.Build.0 = Release|Any CPU
2226
{0241FA41-E396-491A-B4EC-772B694EC689}.Release|x64.ActiveCfg = Release|x64
2327
{0241FA41-E396-491A-B4EC-772B694EC689}.Release|x64.Build.0 = Release|x64
28+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Debug|x64.ActiveCfg = Debug|Any CPU
31+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Debug|x64.Build.0 = Debug|Any CPU
32+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Release|x64.ActiveCfg = Release|Any CPU
35+
{8E898B26-0A4C-4DDA-9820-D5D050D2336E}.Release|x64.Build.0 = Release|Any CPU
36+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Debug|x64.ActiveCfg = Debug|Any CPU
39+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Debug|x64.Build.0 = Debug|Any CPU
40+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Release|Any CPU.Build.0 = Release|Any CPU
42+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Release|x64.ActiveCfg = Release|Any CPU
43+
{DF09EACE-50EC-44EA-849A-80462A219CFC}.Release|x64.Build.0 = Release|Any CPU
2444
EndGlobalSection
2545
GlobalSection(SolutionProperties) = preSolution
2646
HideSolutionNode = FALSE
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<configSections>
4-
<section name="oracle.manageddataaccess.client"
5-
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
6-
</configSections>
7-
<system.data>
8-
<DbProviderFactories>
9-
<remove invariant="Oracle.ManagedDataAccess.Client"/>
10-
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
11-
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
12-
</DbProviderFactories>
13-
</system.data>
14-
<runtime>
15-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
16-
<dependentAssembly>
17-
<publisherPolicy apply="no"/>
18-
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
19-
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/>
20-
</dependentAssembly>
21-
</assemblyBinding>
22-
</runtime>
23-
<oracle.manageddataaccess.client>
24-
<version number="*">
25-
<dataSources>
26-
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/>
27-
</dataSources>
28-
</version>
29-
</oracle.manageddataaccess.client>
303
</configuration>

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/View/JUnitTestResultWindow.cs renamed to PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/JUnitTestResultWindow.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Drawing;
33
using System.Threading;
44
using System.Windows.Forms;
5+
using utPLSQL;
56

67
namespace PlsqlDeveloperUtPlsqlPlugin
78
{
@@ -33,7 +34,7 @@ internal void RunTests(string type, string owner, string name, string subType)
3334

3435
new Thread(() =>
3536
{
36-
testRunner.Run(type, owner, name, subType);
37+
testRunner.RunTests(type, owner, name, subType);
3738
var testsuites = testRunner.GetJUnitResult();
3839

3940
if (testsuites != null)

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.cs

+6-36
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Drawing;
66
using System.Reflection;
77
using System.IO;
8-
using Oracle.ManagedDataAccess.Client;
8+
using utPLSQL;
99

1010
namespace PlsqlDeveloperUtPlsqlPlugin
1111
{
@@ -44,14 +44,13 @@ public class PlsqlDeveloperUtPlsqlPlugin
4444
internal static string password;
4545
internal static string database;
4646

47+
private static RealTimeTestRunner testRunner;
4748
private static RealTimeTestResultWindow testResultWindow;
4849

49-
internal static OracleConnection produceConnection;
50-
internal static OracleConnection consumeConnection;
51-
5250
private PlsqlDeveloperUtPlsqlPlugin()
5351
{
54-
testResultWindow = new RealTimeTestResultWindow();
52+
testRunner = new RealTimeTestRunner();
53+
testResultWindow = new RealTimeTestResultWindow(testRunner);
5554
}
5655

5756
#region DLL exported API
@@ -175,7 +174,7 @@ private static void ConnectToDatabase()
175174
{
176175
try
177176
{
178-
PlsqlDeveloperUtPlsqlPlugin.DisconnectFromDatabase();
177+
testRunner.Close();
179178

180179
if (PlsqlDeveloperUtPlsqlPlugin.connected())
181180
{
@@ -188,11 +187,7 @@ private static void ConnectToDatabase()
188187
password = Marshal.PtrToStringAnsi(ptrPassword);
189188
database = Marshal.PtrToStringAnsi(ptrDatabase);
190189

191-
string connectionString = $"User Id={username};Password={password};Data Source={database}";
192-
produceConnection = new OracleConnection(connectionString);
193-
produceConnection.Open();
194-
consumeConnection = new OracleConnection(connectionString);
195-
consumeConnection.Open();
190+
testRunner.Connect(username, password, database);
196191
}
197192
}
198193
catch (Exception e)
@@ -201,30 +196,5 @@ private static void ConnectToDatabase()
201196
}
202197
}
203198

204-
private static void DisconnectFromDatabase()
205-
{
206-
if (produceConnection != null)
207-
{
208-
try
209-
{
210-
produceConnection.Close();
211-
}
212-
catch (Exception e)
213-
{
214-
MessageBox.Show("Produce Connection " + e.Message);
215-
}
216-
}
217-
else if (consumeConnection != null)
218-
{
219-
try
220-
{
221-
consumeConnection.Close();
222-
}
223-
catch (Exception e)
224-
{
225-
MessageBox.Show("Consume Connectin " + e.Message);
226-
}
227-
}
228-
}
229199
}
230200
}

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.csproj

+13-13
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
6565
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
6666
</Reference>
67-
<Reference Include="Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
68-
<HintPath>..\packages\Oracle.ManagedDataAccess.19.10.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
69-
</Reference>
7067
<Reference Include="RGiesecke.DllExport.Metadata, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8f52d83c1a22df51, processorArchitecture=MSIL">
7168
<HintPath>..\packages\UnmanagedExports.1.2.7\lib\net\RGiesecke.DllExport.Metadata.dll</HintPath>
7269
<Private>False</Private>
@@ -81,30 +78,27 @@
8178
<Reference Include="System.Xml" />
8279
</ItemGroup>
8380
<ItemGroup>
84-
<Compile Include="TestRunner\JUnit4.cs" />
85-
<Compile Include="TestRunner\RealTimeTestRunner.cs" />
86-
<Compile Include="TestRunner\TestRunner.cs" />
87-
<Compile Include="View\RealTimeTestResultWindow.cs">
81+
<Compile Include="RealTimeTestResultWindow.cs">
8882
<SubType>Form</SubType>
8983
</Compile>
90-
<Compile Include="View\RealTimeTestResultWindow.Designer.cs">
84+
<Compile Include="RealTimeTestResultWindow.Designer.cs">
9185
<DependentUpon>RealTimeTestResultWindow.cs</DependentUpon>
9286
</Compile>
93-
<Compile Include="View\JUnitTestResultWindow.cs">
87+
<Compile Include="JUnitTestResultWindow.cs">
9488
<SubType>Form</SubType>
9589
</Compile>
96-
<Compile Include="View\JUnitTestResultWindow.Designer.cs">
90+
<Compile Include="JUnitTestResultWindow.Designer.cs">
9791
<DependentUpon>JUnitTestResultWindow.cs</DependentUpon>
9892
</Compile>
9993
<Compile Include="PlsqlDeveloperUtPlsqlPlugin.cs" />
10094
<Compile Include="Properties\AssemblyInfo.cs" />
101-
<Compile Include="TestRunner\JUnitTestRunner.cs" />
95+
<Compile Include="TestResult.cs" />
10296
</ItemGroup>
10397
<ItemGroup>
104-
<EmbeddedResource Include="View\RealTimeTestResultWindow.resx">
98+
<EmbeddedResource Include="RealTimeTestResultWindow.resx">
10599
<DependentUpon>RealTimeTestResultWindow.cs</DependentUpon>
106100
</EmbeddedResource>
107-
<EmbeddedResource Include="View\JUnitTestResultWindow.resx">
101+
<EmbeddedResource Include="JUnitTestResultWindow.resx">
108102
<DependentUpon>JUnitTestResultWindow.cs</DependentUpon>
109103
</EmbeddedResource>
110104
</ItemGroup>
@@ -122,6 +116,12 @@
122116
<None Include="App.config" />
123117
<None Include="packages.config" />
124118
</ItemGroup>
119+
<ItemGroup>
120+
<ProjectReference Include="..\utPLSQL.Lib\utPLSQL.Lib.csproj">
121+
<Project>{df09eace-50ec-44ea-849a-80462a219cfc}</Project>
122+
<Name>utPLSQL.Lib</Name>
123+
</ProjectReference>
124+
</ItemGroup>
125125
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
126126
<Import Project="..\packages\UnmanagedExports.Repack.1.0.4\build\UnmanagedExports.Repack.targets" Condition="Exists('..\packages\UnmanagedExports.Repack.1.0.4\build\UnmanagedExports.Repack.targets')" />
127127
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+22-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)