8000 Initial commit · utPLSQL/utPLSQL-dotnet-api@208ac82 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 208ac82

Browse files
committed
Initial commit
1 parent 3c2a972 commit 208ac82

16 files changed

+1464
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/.vs
2+
**/build
3+
**/packages
4+
**/**/bin
5+
**/**/obj
6+
/.idea/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<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>
30+
</configuration>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("utPLSQL.Api.Test")]
6+
[assembly: AssemblyDescription("")]
7+
[assembly: AssemblyConfiguration("")]
8+
[assembly: AssemblyCompany("HP Inc.")]
9+
[assembly: AssemblyProduct("utPLSQL.Api.Test")]
10+
[assembly: AssemblyCopyright("Copyright © HP Inc. 2021")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
14+
[assembly: ComVisible(false)]
15+
16+
[assembly: Guid("0da0b937-f3fe-4fdf-8e34-716497a14823")]
17+
18+
// [assembly: AssemblyVersion("1.0.*")]
19+
[assembly: AssemblyVersion("1.0.0.0")]
20+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Oracle.ManagedDataAccess.Client;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
6+
namespace utPLSQL
7+
{
8+
[TestClass]
9+
public class RealTimeTestRunnerTest
10+
{
11+
[TestMethod]
12+
public void TestToscamtest()
13+
{
14+
var testRunner = new RealTimeTestRunner();
15+
testRunner.Connect(username: "toscamtest", password: "toscamtest", database: "CA40");
16+
17+
testRunner.RunTestsWithCoverage(type: "USER", owner: null, name: "toscamtest", procedure: null, coverageSchemas: "'toscam'", "'pa_m720','pa_m770'", null);
18+
19+
var events = new List<@event>();
20+
testRunner.ConsumeResult(@event =>
21+
{
22+
events.Add(@event);
23+
});
24+
25+
Assert.AreEqual("pre-run", events[0].type);
26+
Assert.AreEqual("post-run", events.Last().type);
27+
28+
var report = testRunner.GetCoverageReport();
29+
30+
System.Diagnostics.Trace.WriteLine(report);
31+
}
32+
33+
[TestMethod]
34+
public void TestGetVersion()
35+
{
36+
var testRunner = new RealTimeTestRunner();
37+
testRunner.Connect(username: "toscamtest", password: "toscamtest", database: "CA40");
38+
39+
string version = testRunner.GetVersion();
40+
41+
Assert.AreEqual("v3.1.7.3096", version);
42+
}
43+
44+
[TestMethod]
45+
public void TestGetVersionWhenNotInstalled()
46+
{
47+
var testRunner = new RealTimeTestRunner();
48+
testRunner.Connect(username: "c##sakila", password: "sakila", database: "ORCLCDB");
49+
50+
try
51+
{
52+
string version = testRunner.GetVersion();
53+
Assert.Fail();
54+
}
55+
catch (OracleException e)
56+
{
57+
Assert.AreEqual("ORA-00904: \"UT\".\"VERSION\": ungültige ID", e.Message);
58+
}
59+
}
60+
}
61+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="MSTest.TestAdapter" version="2.1.1" targetFramework="net472" />
4+
<package id="MSTest.TestFramework" version="2.1.1" targetFramework="net472" />
5+
<package id="Oracle.ManagedDataAccess" version="19.10.0" targetFramework="net472" />
6+
</packages>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{0DA0B937-F3FE-4FDF-8E34-716497A14823}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>utPLSQL.Api.Test</RootNamespace>
12+
<AssemblyName>utPLSQL.Api.Test</AssemblyName>
13+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
16+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
17+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
18+
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
19+
<IsCodedUITest>False</IsCodedUITest>
20+
<TestProjectType>UnitTest</TestProjectType>
21+
<NuGetPackageImportStamp>
22+
</NuGetPackageImportStamp>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25+
<DebugSymbols>true</DebugSymbols>
26+
<DebugType>full</DebugType>
27+
<Optimize>false</Optimize>
28+
<OutputPath>bin\Debug\</OutputPath>
29+
<DefineConstants>DEBUG;TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>true</Optimize>
36+
<OutputPath>bin\Release\</OutputPath>
37+
<DefineConstants>TRACE</DefineConstants>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
</PropertyGroup>
41+
<ItemGroup>
42+
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
43+
<HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
44+
</Reference>
45+
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
46+
<HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
47+
</Reference>
48+
<Reference Include="Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
49+
<HintPath>..\packages\Oracle.ManagedDataAccess.19.10.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
50+
</Reference>
51+
<Reference Include="System" />
52+
<Reference Include="System.Core" />
53+
<Reference Include="System.Data" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="Properties\AssemblyInfo.cs" />
57+
<Compile Include="RealTimeTestRunnerTest.cs" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<None Include="App.config" />
61+
<None Include="packages.config" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<ProjectReference Include="..\utPLSQL.Api\utPLSQL.Api.csproj">
65+
<Project>{8180ac2c-d121-49ef-903c-aedf68e06c42}</Project>
66+
<Name>utPLSQL.Api</Name>
67+
</ProjectReference>
68+
</ItemGroup>
69+
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
70+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
71+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
72+
<PropertyGroup>
73+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
74+
</PropertyGroup>
75+
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props'))" />
76+
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets'))" />
77+
</Target>
78+
<Import Project="..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" />
79+
</Project>

utPLSQL.Api/utPLSQL.Api.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30804.86
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "utPLSQL.Api", "utPLSQL.Api\utPLSQL.Api.csproj", "{8180AC2C-D121-49EF-903C-AEDF68E06C42}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "utPLSQL.Api.Test", "utPLSQL.Api.Test\utPLSQL.Api.Test.csproj", "{0DA0B937-F3FE-4FDF-8E34-716497A14823}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{8180AC2C-D121-49EF-903C-AEDF68E06C42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{8180AC2C-D121-49EF-903C-AEDF68E06C42}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{8180AC2C-D121-49EF-903C-AEDF68E06C42}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{8180AC2C-D121-49EF-903C-AEDF68E06C42}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{0DA0B937-F3FE-4FDF-8E34-716497A14823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{0DA0B937-F3FE-4FDF-8E34-716497A14823}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{0DA0B937-F3FE-4FDF-8E34-716497A14823}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{0DA0B937-F3FE-4FDF-8E34-716497A14823}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {05D674DE-47D1-4DA7-8051-46D6FE947CA2}
30+
EndGlobalSection
31+
EndGlobal

utPLSQL.Api/utPLSQL.Api/App.config

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<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>
30+
</configuration>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("utPLSQL.Api")]
9+
[assembly: AssemblyDescription(".NET API for utPLSQL")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("utPLSQL.org")]
12+
[assembly: AssemblyProduct("utPLSQL.Api")]
13+
[assembly: AssemblyCopyright("Copyright © 2021")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("8180ac2c-d121-49ef-903c-aedf68e06c42")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)
0