Permalink
Browse files

Started work on a command-line application to test communications.

Added the ability to use configuration in the NetTcp definition.
  • Loading branch information...
1 parent b75b232 commit f848b1156fe8f75c24e40b6dd95e3999c41f46f0 @csut017 csut017 committed Feb 22, 2011
@@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{07665BC5-89E0-4202-9DE2-B997ABE25815}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CruiseControl.Command", "CruiseControl.Command\CruiseControl.Command.csproj", "{98C04DAE-B479-4096-B8A0-C769997889B2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -77,15 +79,26 @@ Global
{FD186636-F27A-450D-8EDF-E1F93FC57008}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{FD186636-F27A-450D-8EDF-E1F93FC57008}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{FD186636-F27A-450D-8EDF-E1F93FC57008}.Release|x86.ActiveCfg = Release|Any CPU
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Debug|x86.ActiveCfg = Debug|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Debug|x86.Build.0 = Debug|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Release|Any CPU.ActiveCfg = Release|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Release|Mixed Platforms.Build.0 = Release|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Release|x86.ActiveCfg = Release|x86
+ {98C04DAE-B479-4096-B8A0-C769997889B2}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {005FDAB0-6F5B-4C77-BC09-A6E9DC0DE72A} = {16BAE879-D673-464B-9BF4-054C380A43F8}
- {94D3A1D1-6368-4BFD-9D2B-8AA93FE6C7CB} = {07665BC5-89E0-4202-9DE2-B997ABE25815}
- {FD186636-F27A-450D-8EDF-E1F93FC57008} = {07665BC5-89E0-4202-9DE2-B997ABE25815}
{166D519E-854D-4405-9FAE-C6825CF7BBE6} = {D6E317F2-3E0E-4341-9B44-0A0E5CFDB982}
{74405CD5-BD3D-4912-A465-F929FA20220B} = {D6E317F2-3E0E-4341-9B44-0A0E5CFDB982}
+ {FD186636-F27A-450D-8EDF-E1F93FC57008} = {07665BC5-89E0-4202-9DE2-B997ABE25815}
+ {94D3A1D1-6368-4BFD-9D2B-8AA93FE6C7CB} = {07665BC5-89E0-4202-9DE2-B997ABE25815}
+ {005FDAB0-6F5B-4C77-BC09-A6E9DC0DE72A} = {16BAE879-D673-464B-9BF4-054C380A43F8}
+ {98C04DAE-B479-4096-B8A0-C769997889B2} = {16BAE879-D673-464B-9BF4-054C380A43F8}
EndGlobalSection
EndGlobal
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{98C04DAE-B479-4096-B8A0-C769997889B2}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CruiseControl.Command</RootNamespace>
+ <AssemblyName>CruiseControl.Command</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\CruiseControl.Common\CruiseControl.Common.csproj">
+ <Project>{166D519E-854D-4405-9FAE-C6825CF7BBE6}</Project>
+ <Name>CruiseControl.Common</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <StartArguments>net.tcp://localhost:8123/ccnet</StartArguments>
+ </PropertyGroup>
+</Project>
@@ -0,0 +1,12 @@
+namespace CruiseControl.Command
+{
+ using CruiseControl.Common;
+
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ ServerConnection.Ping(args[0]);
+ }
+ }
+}
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CruiseControl.Command")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("CruiseControl.Command")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("4c8aa29d-d0ab-4f19-9b3d-ae39df690641")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -7,6 +7,6 @@
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
- <logger name="*" minlevel="Trace" writeTo="console" />
+ <logger name="*" minlevel="Debug" writeTo="console" />
</rules>
</nlog>
@@ -10,13 +10,33 @@ public class NetTcp
: WcfEndpoint
{
#region Public properties
+ #region ConfigName
+ /// <summary>
+ /// Gets or sets the name of the config section for this binding.
+ /// </summary>
+ /// <value>
+ /// The name of the config section.
+ /// </value>
+ public string ConfigName { get; set; }
+ #endregion
+
#region Binding
/// <summary>
/// Gets the binding.
/// </summary>
public override Binding Binding
{
- get { return new NetTcpBinding(); }
+ get
+ {
+ if (string.IsNullOrEmpty(this.ConfigName))
+ {
+ var binding = new NetTcpBinding();
+ return binding;
+ }
+
+ return new NetTcpBinding(this.ConfigName);
+ }
+
}
#endregion
#endregion
@@ -2,13 +2,18 @@
{
using CruiseControl.Common;
using CruiseControl.Core.Interfaces;
+ using NLog;
/// <summary>
/// The channel implementation for WCF.
/// </summary>
public class WcfChannel
: ICommunicationsChannel
{
+ #region Private fields
+ private static readonly Logger logger = LogManager.GetCurrentClassLogger();
+ #endregion
+
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="WcfChannel"/> class.
@@ -39,6 +44,7 @@ public WcfChannel(IActionInvoker invoker)
/// </returns>
public bool Ping()
{
+ logger.Debug("Responding to ping");
return true;
}
#endregion

0 comments on commit f848b11

Please sign in to comment.