Skip to content

Commit b17f035

Browse files
committed
add Remote Test Harness application
0 parents  commit b17f035

File tree

542 files changed

+9366
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

542 files changed

+9366
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Implementation.docx
2+
compile.bat
3+
run.bat

.vs/RemoteTestHarness/v14/.suo

500 KB
Binary file not shown.

BlockingQueue/BlockingQueue.cs

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*///////////////////////////////////////////////////////////////////////////
2+
// BlockingQueue.cs - Thread safe enqueueing and dequeueing of XDocument//
3+
// objects. //
4+
// ver 1.0 //
5+
// Language: C#, VS 2015 //
6+
// Platform: Windows 10, //
7+
// Application: Test Harness App //
8+
// Author: Rahul Vijaydev //
9+
// //
10+
/////////////////////////////////////////////////////////////////////////////
11+
*
12+
* Module Operations
13+
* -----------------
14+
* This package implements a generic blocking queue and demonstrates
15+
* communication between two threads using an instance of the queue.
16+
* If the queue is empty when a reader attempts to deQ an item then the
17+
* reader will block until the writing thread enQs an item. Thus waiting
18+
* is efficient.This blocking queue is implemented using a Monitor and lock, which is
19+
* equivalent to using a condition variable with a lock.
20+
*
21+
* Public Interface
22+
* ----------------
23+
* BlockingQueue<string> bQ = new BlockingQueue<string>();
24+
* bQ.enQ(msg);
25+
* string msg = bQ.deQ();
26+
*
27+
*
28+
* Build Process
29+
* -------------
30+
* - Required files: BlockingQueue.cs
31+
* - Compiler command: csc BlockingQueue.cs
32+
*
33+
* Maintenance History
34+
* -------------------
35+
* ver 1.0 : 21st November 2016
36+
* - first release
37+
*
38+
*
39+
*/
40+
41+
42+
using System;
43+
using System.Collections;
44+
using System.Threading;
45+
46+
namespace SWTools
47+
{
48+
public class BlockingQueue<T>
49+
{
50+
private Queue blockingQ;
51+
object locker_ = new object();
52+
53+
//constructor
54+
55+
public BlockingQueue()
56+
{
57+
blockingQ = new Queue();
58+
}
59+
//enqueueing object of type T
60+
61+
public void enQ(T msg)
62+
{
63+
// uses Monitor
64+
lock (locker_)
65+
{
66+
blockingQ.Enqueue(msg);
67+
Monitor.Pulse(locker_);
68+
}
69+
}
70+
//dequeue object of type T
71+
72+
public T deQ()
73+
{
74+
T msg = default(T);
75+
lock (locker_)
76+
{
77+
while (this.size() == 0)
78+
{
79+
Monitor.Wait(locker_);
80+
}
81+
msg = (T)blockingQ.Dequeue();
82+
return msg;
83+
}
84+
}
85+
//returns the numbe of elements in the queue
86+
87+
public int size()
88+
{
89+
int count;
90+
lock (locker_) { count = blockingQ.Count; }
91+
return count;
92+
}
93+
//remove all elements from queue
94+
95+
public void clear()
96+
{
97+
lock (locker_) { blockingQ.Clear(); }
98+
}
99+
}
100+
101+
#if(TEST_BLOCKINGQUEUE)
102+
103+
class Program
104+
{
105+
static void Main(string[] args)
106+
{
107+
Console.Write("\n Testing Monitor-Based Blocking Queue");
108+
Console.Write("\n ======================================");
109+
110+
SWTools.BlockingQueue<string> q = new SWTools.BlockingQueue<string>();
111+
Thread t = new Thread(() =>
112+
{
113+
string msg;
114+
while (true)
115+
{
116+
msg = q.deQ(); Console.Write("\n child thread received {0}", msg);
117+
if (msg == "quit") break;
118+
}
119+
});
120+
t.Start();
121+
string sendMsg = "msg #";
122+
for (int i = 0; i < 20; ++i)
123+
{
124+
string temp = sendMsg + i.ToString();
125+
Console.Write("\n main thread sending {0}", temp);
126+
q.enQ(temp);
127+
}
128+
q.enQ("quit");
129+
t.Join();
130+
Console.Write("\n\n");
131+
}
132+
}
133+
#endif
134+
}
135+
136+

BlockingQueue/BlockingQueue.csproj

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{36B4691E-11EA-46CB-95B7-BA89A529AD08}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>BlockingQueue</RootNamespace>
11+
<AssemblyName>BlockingQueue</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="System.Data.DataSetExtensions" />
37+
<Reference Include="Microsoft.CSharp" />
38+
<Reference Include="System.Data" />
39+
<Reference Include="System.Net.Http" />
40+
<Reference Include="System.Xml" />
41+
</ItemGroup>
42+
<ItemGroup>
43+
<Compile Include="BlockingQueue.cs" />
44+
<Compile Include="Properties\AssemblyInfo.cs" />
45+
</ItemGroup>
46+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
47+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
48+
Other similar extension points exist, see Microsoft.Common.targets.
49+
<Target Name="BeforeBuild">
50+
</Target>
51+
<Target Name="AfterBuild">
52+
</Target>
53+
-->
54+
</Project>
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("BlockingQueue")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("BlockingQueue")]
13+
[assembly: AssemblyCopyright("Copyright © 2016")]
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("36b4691e-11ea-46cb-95b7-ba89a529ad08")]
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")]
5 KB
Binary file not shown.
11.5 KB
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
C:\Users\RAHUL VIJAYDEV\documents\visual studio 2015\Projects_rajuru\RemoteTestHarness\BlockingQueue\bin\Debug\BlockingQueue.dll
2+
C:\Users\RAHUL VIJAYDEV\documents\visual studio 2015\Projects_rajuru\RemoteTestHarness\BlockingQueue\bin\Debug\BlockingQueue.pdb
3+
C:\Users\RAHUL VIJAYDEV\documents\visual studio 2015\Projects_rajuru\RemoteTestHarness\BlockingQueue\obj\Debug\BlockingQueue.dll
4+
C:\Users\RAHUL VIJAYDEV\documents\visual studio 2015\Projects_rajuru\RemoteTestHarness\BlockingQueue\obj\Debug\BlockingQueue.pdb
5+
F:\VisualStudioProjects\RemoteTestHarness\BlockingQueue\bin\Debug\BlockingQueue.dll
6+
F:\VisualStudioProjects\RemoteTestHarness\BlockingQueue\bin\Debug\BlockingQueue.pdb
7+
F:\VisualStudioProjects\RemoteTestHarness\BlockingQueue\obj\Debug\BlockingQueue.dll
8+
F:\VisualStudioProjects\RemoteTestHarness\BlockingQueue\obj\Debug\BlockingQueue.pdb
9+
F:\VisualStudioProjects\RemoteTestHarness\BlockingQueue\obj\Debug\BlockingQueue.csprojResolveAssemblyReference.cache
Binary file not shown.
5 KB
Binary file not shown.
11.5 KB
Binary file not shown.
Binary file not shown.

BlockingQueue/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Whitespace-only changes.

BlockingQueue/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Whitespace-only changes.

BlockingQueue/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

Whitespace-only changes.

Client/App.config

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+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>

Client/Client.csproj

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5A9A3E3C-C5A3-428E-AA72-38A84E51326A}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Client</RootNamespace>
11+
<AssemblyName>Client</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="ClientTH.cs" />
47+
<Compile Include="Properties\AssemblyInfo.cs" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="App.config" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<ProjectReference Include="..\Communication\Communication.csproj">
54+
<Project>{3633F6C5-0D3D-48A6-9AED-15840138E2B5}</Project>
55+
<Name>Communication</Name>
56+
</ProjectReference>
57+
<ProjectReference Include="..\Messages\Messages.csproj">
58+
<Project>{3540C1FF-17BD-4975-872E-BF193E327019}</Project>
59+
<Name>Messages</Name>
60+
</ProjectReference>
61+
<ProjectReference Include="..\Serialization\Serialization.csproj">
62+
<Project>{2A02CDC1-8D17-4C99-AD2B-A6A70ADA1F5E}</Project>
63+
<Name>Serialization</Name>
64+
</ProjectReference>
65+
<ProjectReference Include="..\THMessages\TestHarnessMessage.csproj">
66+
<Project>{D920FD94-F73B-426A-8669-46CA68F49864}</Project>
67+
<Name>TestHarnessMessage</Name>
68+
</ProjectReference>
69+
</ItemGroup>
70+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
71+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
72+
Other similar extension points exist, see Microsoft.Common.targets.
73+
<Target Name="BeforeBuild">
74+
</Target>
75+
<Target Name="AfterBuild">
76+
</Target>
77+
-->
78+
</Project>

0 commit comments

Comments
 (0)