Skip to content

Commit 50c6f66

Browse files
committed
Merge branch 'develop'
2 parents 318e807 + e336d5c commit 50c6f66

38 files changed

+748
-235
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ cache: apt
77
script:
88
- xbuild /p:Configuration=Release IntegrationEngine.sln
99
- mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe ./IntegrationEngine.Model.Tests/bin/Release/IntegrationEngine.Model.Tests.dll
10+
- mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe ./IntegrationEngine.Core.Tests/bin/Release/IntegrationEngine.Core.Tests.dll
1011
- mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe ./IntegrationEngine.Tests/bin/Release/IntegrationEngine.Tests.dll
12+
- mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe ./IntegrationEngine.Client.Tests/bin/Release/IntegrationEngine.Client.Tests.dll
13+

IntegrationEngine.Client.net40/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
8-
[assembly: AssemblyTitle("IntegrationEngine.Client.net40")]
8+
[assembly: AssemblyTitle("IntegrationEngine.Client")]
99

1010
// Setting ComVisible to false makes the types in this assembly not visible
1111
// to COM components. If you need to access a type in this assembly from

IntegrationEngine.ConsoleHost/IntegrationJobs/SampleSqlReport/SampleSqlReportJob.cs

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,31 @@ public class SampleSqlReportJob : SqlJob
1111
{
1212
public override void Run()
1313
{
14-
var report = new SampleReport() {
15-
Created = DateTime.Now,
16-
Data = new System.Collections.Generic.List<SampleDatum>(),
17-
//Data = RunQuery<SampleDatum>(),
18-
};
14+
try
15+
{
16+
var report = new SampleReport() {
17+
Created = DateTime.Now,
18+
Data = new System.Collections.Generic.List<SampleDatum>(),
19+
//Data = RunQuery<SampleDatum>(),
20+
};
1921

20-
// Write result to Elasticsearch
22+
// Pass into Razor engine
23+
string template = "Created on <strong>@Model.Created</strong> with <strong>@Model.Data.Count</strong> records.";
24+
var html = Engine.Razor.RunCompile(template, "template-01", typeof(SampleReport), report);
2125

22-
// Pass into Razor engine
23-
string template = "Created on <strong>@Model.Created</strong> with <strong>@Model.Data.Count</strong> records.";
24-
var html = Engine.Razor.RunCompile(template, "template-01", typeof(SampleReport), report);
25-
26-
// Send Mail
27-
var mailMessage = new MailMessage();
28-
mailMessage.To.Add("ethanhann@gmail.com");
29-
mailMessage.Subject = "Sample SQL Report";
30-
mailMessage.From = new MailAddress("root@localhost");
31-
mailMessage.Body = html;
32-
mailMessage.IsBodyHtml = true;
33-
MailClient.Send(mailMessage);
26+
// Send Mail
27+
var mailMessage = new MailMessage();
28+
mailMessage.To.Add("ethanhann@gmail.com");
29+
mailMessage.Subject = "Sample SQL Report";
30+
mailMessage.From = new MailAddress("root@localhost");
31+
mailMessage.Body = html;
32+
mailMessage.IsBodyHtml = true;
33+
MailClient.Send(mailMessage);
34+
}
35+
catch (Exception exception)
36+
{
37+
throw new IntegrationJobRunFailureException("SampleSqlReportJob failed.", exception);
38+
}
3439
}
3540
}
3641
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<configSections>
4+
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
5+
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
6+
</configSections>
7+
<entityFramework>
8+
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
9+
<parameters>
10+
<parameter value="mssqllocaldb" />
11+
</parameters>
12+
</defaultConnectionFactory>
13+
<providers>
14+
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
15+
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
16+
</provider></providers>
17+
</entityFramework>
18+
<system.data>
19+
<DbProviderFactories>
20+
<remove invariant="MySql.Data.MySqlClient" />
21+
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
22+
</DbProviderFactories>
23+
</system.data></configuration>
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.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>{9332D22A-0D09-4DA7-B2F9-6DE7E9F28715}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>IntegrationEngine.Core</RootNamespace>
11+
<AssemblyName>IntegrationEngine.Core</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
15+
<RestorePackages>true</RestorePackages>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
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+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>lib\net40\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="Common.Logging">
36+
<HintPath>..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll</HintPath>
37+
</Reference>
38+
<Reference Include="Common.Logging.Core">
39+
<HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath>
40+
</Reference>
41+
<Reference Include="Common.Logging.NLog31">
42+
<HintPath>..\packages\Common.Logging.NLog31.3.0.0\lib\net40\Common.Logging.NLog31.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Elasticsearch.Net">
45+
<HintPath>..\packages\Elasticsearch.Net.1.3.1\lib\Elasticsearch.Net.dll</HintPath>
46+
</Reference>
47+
<Reference Include="EntityFramework">
48+
<HintPath>..\packages\EntityFramework.6.1.2\lib\net40\EntityFramework.dll</HintPath>
49+
</Reference>
50+
<Reference Include="EntityFramework.SqlServer">
51+
<HintPath>..\packages\EntityFramework.6.1.2\lib\net40\EntityFramework.SqlServer.dll</HintPath>
52+
</Reference>
53+
<Reference Include="MySql.Data">
54+
<HintPath>..\packages\MySql.Data.6.9.5\lib\net40\MySql.Data.dll</HintPath>
55+
</Reference>
56+
<Reference Include="MySql.Data.Entity.EF6">
57+
<HintPath>..\packages\MySql.Data.Entity.6.9.5\lib\net40\MySql.Data.Entity.EF6.dll</HintPath>
58+
</Reference>
59+
<Reference Include="Nest">
60+
<HintPath>..\packages\NEST.1.3.1\lib\Nest.dll</HintPath>
61+
</Reference>
62+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
63+
<SpecificVersion>False</SpecificVersion>
64+
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
65+
</Reference>
66+
<Reference Include="NLog">
67+
<HintPath>..\packages\NLog.3.1.0.0\lib\net40\NLog.dll</HintPath>
68+
</Reference>
69+
<Reference Include="RabbitMQ.Client">
70+
<HintPath>..\packages\RabbitMQ.Client.3.4.3\lib\net35\RabbitMQ.Client.dll</HintPath>
71+
</Reference>
72+
<Reference Include="System" />
73+
<Reference Include="System.ComponentModel.DataAnnotations" />
74+
<Reference Include="System.Core" />
75+
<Reference Include="System.Xml.Linq" />
76+
<Reference Include="System.Data.DataSetExtensions" />
77+
<Reference Include="Microsoft.CSharp" />
78+
<Reference Include="System.Data" />
79+
<Reference Include="System.Xml" />
80+
</ItemGroup>
81+
<ItemGroup>
82+
<Compile Include="..\configuration\SharedAssemblyInfo.cs">
83+
<Link>Properties\SharedAssemblyInfo.cs</Link>
84+
</Compile>
85+
<Compile Include="..\IntegrationEngine.Core\Configuration\DatabaseConfiguration.cs">
86+
<Link>DatabaseConfiguration.cs</Link>
87+
</Compile>
88+
<Compile Include="..\IntegrationEngine.Core\Configuration\MailConfiguration.cs">
89+
<Link>MailConfiguration.cs</Link>
90+
</Compile>
91+
<Compile Include="..\IntegrationEngine.Core\Jobs\IElasticsearchJob.cs">
92+
<Link>IElasticsearchJob.cs</Link>
93+
</Compile>
94+
<Compile Include="..\IntegrationEngine.Core\Jobs\IIntegrationJob.cs">
95+
<Link>IIntegrationJob.cs</Link>
96+
</Compile>
97+
<Compile Include="..\IntegrationEngine.Core\Jobs\ILogJob.cs">
98+
<Link>ILogJob.cs</Link>
99+
</Compile>
100+
<Compile Include="..\IntegrationEngine.Core\Jobs\IMailJob.cs">
101+
<Link>IMailJob.cs</Link>
102+
</Compile>
103+
<Compile Include="..\IntegrationEngine.Core\Jobs\IntegrationJobRunFailureException.cs">
104+
<Link>IntegrationJobRunFailureException.cs</Link>
105+
</Compile>
106+
<Compile Include="..\IntegrationEngine.Core\Jobs\IParameterizedJob.cs">
107+
<Link>IParameterizedJob.cs</Link>
108+
</Compile>
109+
<Compile Include="..\IntegrationEngine.Core\Jobs\ISqlJob.cs">
110+
<Link>ISqlJob.cs</Link>
111+
</Compile>
112+
<Compile Include="..\IntegrationEngine.Core\Jobs\SqlJob.cs">
113+
<Link>SqlJob.cs</Link>
114+
</Compile>
115+
<Compile Include="..\IntegrationEngine.Core\Mail\IMailClient.cs">
116+
<Link>IMailClient.cs</Link>
117+
</Compile>
118+
<Compile Include="..\IntegrationEngine.Core\Mail\ISmtpClient.cs">
119+
<Link>ISmtpClient.cs</Link>
120+
</Compile>
121+
<Compile Include="..\IntegrationEngine.Core\Mail\ITcpClient.cs">
122+
<Link>ITcpClient.cs</Link>
123+
</Compile>
124+
<Compile Include="..\IntegrationEngine.Core\Mail\MailClient.cs">
125+
<Link>MailClient.cs</Link>
126+
</Compile>
127+
<Compile Include="..\IntegrationEngine.Core\Mail\SmtpClientAdapter.cs">
128+
<Link>SmtpClientAdapter.cs</Link>
129+
</Compile>
130+
<Compile Include="..\IntegrationEngine.Core\Reports\IDatum.cs">
131+
<Link>IDatum.cs</Link>
132+
</Compile>
133+
<Compile Include="..\IntegrationEngine.Core\Reports\IReport.cs">
134+
<Link>IReport.cs</Link>
135+
</Compile>
136+
<Compile Include="..\IntegrationEngine.Core\R\RScriptRunner.cs">
137+
<Link>RScriptRunner.cs</Link>
138+
</Compile>
139+
<Compile Include="..\IntegrationEngine.Core\Storage\DatabaseInitializer.cs">
140+
<Link>DatabaseInitializer.cs</Link>
141+
</Compile>
142+
<Compile Include="..\IntegrationEngine.Core\Storage\DatabaseRepository.cs">
143+
<Link>DatabaseRepository.cs</Link>
144+
</Compile>
145+
<Compile Include="..\IntegrationEngine.Core\Storage\ElasticsearchRepository.cs">
146+
<Link>ElasticsearchRepository.cs</Link>
147+
</Compile>
148+
<Compile Include="..\IntegrationEngine.Core\Storage\IDatabaseRepository.cs">
149+
<Link>IDatabaseRepository.cs</Link>
150+
</Compile>
151+
<Compile Include="..\IntegrationEngine.Core\Storage\IElasticsearchRepository.cs">
152+
<Link>IElasticsearchRepository.cs</Link>
153+
</Compile>
154+
<Compile Include="..\IntegrationEngine.Core\Storage\IntegrationEngineContext.cs">
155+
<Link>IntegrationEngineContext.cs</Link>
156+
</Compile>
157+
<Compile Include="..\IntegrationEngine.Core\Storage\IntegrationEngineDbConfiguration.cs">
158+
<Link>IntegrationEngineDbConfiguration.cs</Link>
159+
</Compile>
160+
<Compile Include="..\IntegrationEngine.Core\Storage\IRepository.cs">
161+
<Link>IRepository.cs</Link>
162+
</Compile>
163+
<Compile Include="Properties\AssemblyInfo.cs" />
164+
</ItemGroup>
165+
<ItemGroup>
166+
<None Include="App.config" />
167+
<None Include="packages.config" />
168+
</ItemGroup>
169+
<ItemGroup>
170+
<ProjectReference Include="..\IntegrationEngine.Model.net40\IntegrationEngine.Model.net40.csproj">
171+
<Project>{dfcd19ce-a96a-4b19-8cf1-9cac560e7f42}</Project>
172+
<Name>IntegrationEngine.Model.net40</Name>
173+
</ProjectReference>
174+
</ItemGroup>
175+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
176+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
177+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
178+
<PropertyGroup>
179+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
180+
</PropertyGroup>
181+
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
182+
</Target>
183+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
184+
Other similar extension points exist, see Microsoft.Common.targets.
185+
<Target Name="BeforeBuild">
186+
</Target>
187+
<Target Name="AfterBuild">
188+
</Target>
189+
-->
190+
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("IntegrationEngine.Core")]
6+
[assembly: ComVisible(false)]
7+
[assembly: Guid("549ff47c-42e1-49ce-a1a3-191e88f9c2ec")]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Common.Logging" version="3.0.0" targetFramework="net40" />
4+
<package id="Common.Logging.Core" version="3.0.0" targetFramework="net40" />
5+
<package id="Common.Logging.NLog31" version="3.0.0" targetFramework="net40" />
6+
<package id="Elasticsearch.Net" version="1.3.1" targetFramework="net40" />
7+
<package id="EntityFramework" version="6.1.2" targetFramework="net40" />
8+
<package id="MySql.Data" version="6.9.5" targetFramework="net40" />
9+
<package id="MySql.Data.Entity" version="6.9.5" targetFramework="net40" />
10+
<package id="NEST" version="1.3.1" targetFramework="net40" />
11+
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net40" />
12+
<package id="NLog" version="3.1.0.0" targetFramework="net40" />
13+
<package id="RabbitMQ.Client" version="3.4.3" targetFramework="net40" />
14+
</packages>

IntegrationEngine.Core/IntegrationEngine.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<Compile Include="Jobs\IIntegrationJob.cs" />
8787
<Compile Include="Jobs\ILogJob.cs" />
8888
<Compile Include="Jobs\IMailJob.cs" />
89+
<Compile Include="Jobs\IntegrationJobRunFailureException.cs" />
8990
<Compile Include="Jobs\IParameterizedJob.cs" />
9091
<Compile Include="Jobs\ISqlJob.cs" />
9192
<Compile Include="Jobs\SqlJob.cs" />
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Runtime.Serialization;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace IntegrationEngine.Core.Jobs
9+
{
10+
public class IntegrationJobRunFailureException : Exception
11+
{
12+
public IntegrationJobRunFailureException()
13+
{}
14+
15+
public IntegrationJobRunFailureException(string message)
16+
: base(message)
17+
{}
18+
19+
public IntegrationJobRunFailureException(string message, Exception innerException)
20+
: base(message, innerException)
21+
{}
22+
}
23+
}

IntegrationEngine.Core/Mail/MailClient.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using Common.Logging;
22
using IntegrationEngine.Core.Configuration;
33
using System;
4+
using System.IO;
45
using System.Net.Mail;
56
using System.Net.Sockets;
6-
using System.IO;
7-
using System.Text;
7+
using System.Reflection;
88

99
namespace IntegrationEngine.Core.Mail
1010
{
@@ -17,6 +17,7 @@ public class MailClient : IMailClient
1717
public MailClient()
1818
{
1919
SmtpClient = new SmtpClientAdapter();
20+
Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
2021
}
2122

2223
public MailClient (ILog log) : this()
@@ -26,10 +27,10 @@ public MailClient (ILog log) : this()
2627

2728
public void Send(MailMessage mailMessage)
2829
{
29-
SmtpClient.Host = MailConfiguration.HostName;
30-
SmtpClient.Port = MailConfiguration.Port;
3130
try
3231
{
32+
SmtpClient.Host = MailConfiguration.HostName;
33+
SmtpClient.Port = MailConfiguration.Port;
3334
SmtpClient.Send(mailMessage);
3435
}
3536
catch (Exception exception)

0 commit comments

Comments
 (0)